| 1031 | // Serial peripheral support |
| 1032 | |
| 1033 | void Xbox360Peripheral::SerialConnect(void) |
| 1034 | { |
| 1035 | SerialDisconnect(); |
| 1036 | serialHandler = new ChatPadKeyboardClass; |
| 1037 | if (serialHandler != NULL) |
| 1038 | { |
| 1039 | const OSString *keys[] = { |
| 1040 | OSString::withCString(kIOSerialDeviceType), |
| 1041 | }; |
| 1042 | const OSObject *objects[] = { |
| 1043 | OSNumber::withNumber((unsigned long long)0, 32), |
| 1044 | }; |
| 1045 | OSDictionary *dictionary = OSDictionary::withObjects(objects, keys, sizeof(keys) / sizeof(keys[0]), 0); |
| 1046 | if (serialHandler->init(dictionary)) |
| 1047 | { |
| 1048 | serialHandler->attach(this); |
| 1049 | serialHandler->start(this); |
| 1050 | } |
| 1051 | else |
| 1052 | { |
| 1053 | serialHandler->release(); |
| 1054 | serialHandler = NULL; |
| 1055 | } |
| 1056 | } |
| 1057 | } |
| 1058 | |
| 1059 | void Xbox360Peripheral::SerialDisconnect(void) |
| 1060 | { |