Lines Matching refs:PortRole

135 string appendRoleNodeHelper(const string &portName, PortRole::Tag tag) {  in appendRoleNodeHelper()
139 case PortRole::dataRole: in appendRoleNodeHelper()
141 case PortRole::powerRole: in appendRoleNodeHelper()
143 case PortRole::mode: in appendRoleNodeHelper()
150 string convertRoletoString(PortRole role) { in convertRoletoString()
151 if (role.getTag() == PortRole::powerRole) { in convertRoletoString()
152 if (role.get<PortRole::powerRole>() == PortPowerRole::SOURCE) in convertRoletoString()
154 else if (role.get<PortRole::powerRole>() == PortPowerRole::SINK) in convertRoletoString()
156 } else if (role.getTag() == PortRole::dataRole) { in convertRoletoString()
157 if (role.get<PortRole::dataRole>() == PortDataRole::HOST) in convertRoletoString()
159 if (role.get<PortRole::dataRole>() == PortDataRole::DEVICE) in convertRoletoString()
161 } else if (role.getTag() == PortRole::mode) { in convertRoletoString()
162 if (role.get<PortRole::mode>() == PortMode::UFP) in convertRoletoString()
164 if (role.get<PortRole::mode>() == PortMode::DFP) in convertRoletoString()
182 string filename = appendRoleNodeHelper(string(portName.c_str()), PortRole::mode); in switchToDrp()
200 bool switchMode(const string &portName, const PortRole &in_role, struct Usb *usb) { in switchMode()
279 const PortRole& in_role, int64_t in_transactionId) { in switchRole()
294 if (in_role.getTag() == PortRole::mode) { in switchRole()
363 Status getCurrentRoleHelper(const string &portName, bool connected, PortRole *currentRole) { in getCurrentRoleHelper()
370 if (currentRole->getTag() == PortRole::powerRole) { in getCurrentRoleHelper()
372 currentRole->set<PortRole::powerRole>(PortPowerRole::NONE); in getCurrentRoleHelper()
373 } else if (currentRole->getTag() == PortRole::dataRole) { in getCurrentRoleHelper()
375 currentRole->set<PortRole::dataRole>(PortDataRole::NONE); in getCurrentRoleHelper()
376 } else if (currentRole->getTag() == PortRole::mode) { in getCurrentRoleHelper()
378 currentRole->set<PortRole::mode>(PortMode::NONE); in getCurrentRoleHelper()
386 if (currentRole->getTag() == PortRole::mode) { in getCurrentRoleHelper()
391 currentRole->set<PortRole::mode>(PortMode::AUDIO_ACCESSORY); in getCurrentRoleHelper()
394 currentRole->set<PortRole::mode>(PortMode::DEBUG_ACCESSORY); in getCurrentRoleHelper()
408 currentRole->set<PortRole::powerRole>(PortPowerRole::SOURCE); in getCurrentRoleHelper()
410 currentRole->set<PortRole::powerRole>(PortPowerRole::SINK); in getCurrentRoleHelper()
412 if (currentRole->getTag() == PortRole::dataRole) in getCurrentRoleHelper()
413 currentRole->set<PortRole::dataRole>(PortDataRole::HOST); in getCurrentRoleHelper()
415 currentRole->set<PortRole::mode>(PortMode::DFP); in getCurrentRoleHelper()
417 if (currentRole->getTag() == PortRole::dataRole) in getCurrentRoleHelper()
418 currentRole->set<PortRole::dataRole>(PortDataRole::DEVICE); in getCurrentRoleHelper()
420 currentRole->set<PortRole::mode>(PortMode::UFP); in getCurrentRoleHelper()
485 PortRole currentRole; in getPortStatusHelper()
486 currentRole.set<PortRole::powerRole>(PortPowerRole::NONE); in getPortStatusHelper()
488 (*currentPortStatus)[i].currentPowerRole = currentRole.get<PortRole::powerRole>(); in getPortStatusHelper()
494 currentRole.set<PortRole::dataRole>(PortDataRole::NONE); in getPortStatusHelper()
496 (*currentPortStatus)[i].currentDataRole = currentRole.get<PortRole::dataRole>(); in getPortStatusHelper()
502 currentRole.set<PortRole::mode>(PortMode::NONE); in getPortStatusHelper()
504 (*currentPortStatus)[i].currentMode = currentRole.get<PortRole::mode>(); in getPortStatusHelper()