Lines Matching refs:mode
49 if (path_ == "/data/service/el1/public/usb/mode") {
71 int32_t UsbdPort::WritePortFile(int32_t powerRole, int32_t dataRole, int32_t mode)
75 if (mode == PORT_MODE_HOST || mode == PORT_MODE_DEVICE) {
76 switch (mode) {
109 int32_t UsbdPort::ReadPortFile(int32_t &powerRole, int32_t &dataRole, int32_t &mode)
129 mode = PORT_MODE_HOST;
136 mode = PORT_MODE_DEVICE;
140 HDF_LOGE("%{public}s: read invalid mode: %{public}s", __func__, modeBuf);
157 int32_t mode = PORT_MODE_DEVICE;
159 mode = PORT_MODE_HOST;
163 mode = PORT_MODE_DEVICE;
166 if (WritePortFile(powerRole, dataRole, mode)) {
172 currentPortInfo_.mode = mode;
173 if (currentPortInfo_.mode == PORT_MODE_DEVICE) {
196 int32_t UsbdPort::QueryPort(int32_t &portId, int32_t &powerRole, int32_t &dataRole, int32_t &mode)
198 (void)ReadPortFile(currentPortInfo_.powerRole, currentPortInfo_.dataRole, currentPortInfo_.mode);
202 mode = currentPortInfo_.mode;
206 int32_t UsbdPort::UpdatePort(int32_t mode, const sptr<IUsbdSubscriber> &subscriber)
208 switch (mode) {
212 currentPortInfo_.mode = PORT_MODE_HOST;
217 currentPortInfo_.mode = PORT_MODE_DEVICE;
220 HDF_LOGE("%{public}s invalid mode:%{public}d", __func__, mode);