├── Arduino(iOS ADK sample) └── iOS_ADK │ ├── applet │ ├── HardwareSerial.cpp.o │ ├── Print.cpp.o │ ├── Servo │ │ └── Servo.cpp.o │ ├── WInterrupts.c.o │ ├── WMath.cpp.o │ ├── Wire │ │ ├── Wire.cpp.o │ │ └── utility │ │ │ └── twi.c.o │ ├── core.a │ ├── iOS_ADK.cpp │ ├── iOS_ADK.cpp.eep │ ├── iOS_ADK.cpp.elf │ ├── iOS_ADK.cpp.hex │ ├── iOS_ADK.cpp.o │ ├── pins_arduino.c.o │ ├── wiring.c.o │ ├── wiring_analog.c.o │ ├── wiring_digital.c.o │ ├── wiring_pulse.c.o │ └── wiring_shift.c.o │ └── iOS_ADK.pde ├── Classes ├── SerialCommunication.h ├── SerialCommunication.m └── cocoaasyncsocket │ ├── AsyncSocket.h │ ├── AsyncSocket.m │ ├── AsyncUdpSocket.h │ └── AsyncUdpSocket.m ├── DerivedData └── serialCommunication │ ├── .DS_Store │ └── Build │ ├── .DS_Store │ └── Products │ ├── .DS_Store │ └── Debug-framework │ └── SerialCommunication.framework │ ├── Headers │ ├── Resources │ ├── SerialCommunication │ └── Versions │ ├── A │ ├── Headers │ │ └── SerialCommunication.h │ ├── Resources │ │ └── Info.plist │ └── SerialCommunication │ └── Current ├── Info.plist ├── README.md ├── Serial ├── Makefile ├── serial ├── serial.c └── serial.h ├── SerialCommunicationSkeleton.zip ├── image ├── SerialCommunicationframework APP image.PNG ├── iOS ADK.jpg └── iOS ADK_S.jpg ├── serialCommunication-Prefix.pch └── serialCommunication.xcodeproj ├── project.pbxproj ├── project.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ ├── sekikawayusuke.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── WorkspaceSettings.xcsettings │ └── yusukesekikawa.xcuserdatad │ └── UserInterfaceState.xcuserstate └── xcuserdata ├── sekikawayusuke.xcuserdatad ├── xcdebugger │ └── Breakpoints.xcbkptlist └── xcschemes │ ├── Debug.xcscheme │ ├── serialInput.xcscheme │ └── xcschememanagement.plist └── yusukesekikawa.xcuserdatad └── xcschemes ├── serialCommunication.xcscheme └── xcschememanagement.plist /Arduino(iOS ADK sample)/iOS_ADK/applet/HardwareSerial.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/HardwareSerial.cpp.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/Print.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/Print.cpp.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/Servo/Servo.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/Servo/Servo.cpp.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/WInterrupts.c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/WInterrupts.c.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/WMath.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/WMath.cpp.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/Wire/Wire.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/Wire/Wire.cpp.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/Wire/utility/twi.c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/Wire/utility/twi.c.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/core.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/core.a -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/iOS_ADK.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SerialCommunication.framework for iOS 3 | * iOS_ADK 4 | * 5 | * Copyright (c) Yusuke Sekikawa, 11/06/02 6 | * All rights reserved. 7 | * 8 | * BSD License 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, are 11 | * permitted provided that the following conditions are met: 12 | * - Redistributions of source code must retain the above copyright notice, this list of 13 | * conditions and the following disclaimer. 14 | * - Redistributions in binary form must reproduce the above copyright notice, this list 15 | * of conditions and the following disclaimer in the documentation and/or other materia 16 | * ls provided with the distribution. 17 | * - Neither the name of the "Yuichi Yoshida" nor the names of its contributors may be u 18 | * sed to endorse or promote products derived from this software without specific prior 19 | * written permission. 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY E 21 | * XPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES O 22 | * F MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SH 23 | * ALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENT 24 | * AL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROC 25 | * UREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS I 26 | * NTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI 27 | * CT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF T 28 | * HE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | 32 | 33 | #include 34 | #include 35 | 36 | 37 | #define LED3_RED 2 38 | #define LED3_GREEN 4 39 | #define LED3_BLUE 3 40 | 41 | #define LED2_RED 5 42 | #define LED2_GREEN 7 43 | #define LED2_BLUE 6 44 | 45 | #define LED1_RED 8 46 | #define LED1_GREEN 18 47 | //#define LED1_GREEN 10 48 | #define LED1_BLUE 9 49 | 50 | #define SERVO1 11 51 | #define SERVO2 12 52 | #define SERVO3 13 53 | 54 | #define RELAY1 14 55 | #define RELAY2 15 56 | 57 | #define LIGHT_SENSOR 16 58 | #define TEMP_SENSOR 17 59 | 60 | #define BUTTON1 10 61 | //#define BUTTON1 18 62 | #define BUTTON2 19 63 | #define BUTTON3 20 64 | 65 | 66 | #include "WProgram.h" 67 | void init_buttons(); 68 | void init_relays(); 69 | void init_leds(); 70 | void setup(); 71 | void loop(); 72 | Servo servos[3]; 73 | int len = 0;//byte recieved 74 | 75 | 76 | void setup(); 77 | void loop(); 78 | 79 | void init_buttons() 80 | { 81 | pinMode(BUTTON1, INPUT); 82 | pinMode(BUTTON2, INPUT); 83 | pinMode(BUTTON3, INPUT); 84 | 85 | // enable the internal pullups 86 | digitalWrite(BUTTON1, HIGH); 87 | digitalWrite(BUTTON2, HIGH); 88 | digitalWrite(BUTTON3, HIGH); 89 | } 90 | 91 | 92 | void init_relays() 93 | { 94 | pinMode(RELAY1, OUTPUT); 95 | pinMode(RELAY2, OUTPUT); 96 | } 97 | 98 | 99 | void init_leds() 100 | { 101 | digitalWrite(LED1_RED, 1); 102 | digitalWrite(LED1_GREEN, 1); 103 | digitalWrite(LED1_BLUE, 1); 104 | 105 | pinMode(LED1_RED, OUTPUT); 106 | pinMode(LED1_GREEN, OUTPUT); 107 | pinMode(LED1_BLUE, OUTPUT); 108 | 109 | digitalWrite(LED2_RED, 1); 110 | digitalWrite(LED2_GREEN, 1); 111 | digitalWrite(LED2_BLUE, 1); 112 | 113 | pinMode(LED2_RED, OUTPUT); 114 | pinMode(LED2_GREEN, OUTPUT); 115 | pinMode(LED2_BLUE, OUTPUT); 116 | 117 | digitalWrite(LED3_RED, 1); 118 | digitalWrite(LED3_GREEN, 1); 119 | digitalWrite(LED3_BLUE, 1); 120 | 121 | pinMode(LED3_RED, OUTPUT); 122 | pinMode(LED3_GREEN, OUTPUT); 123 | pinMode(LED3_BLUE, OUTPUT); 124 | } 125 | 126 | void init_joystick(int threshold); 127 | 128 | byte b1, b2, b3, b4, c; 129 | void setup() 130 | { 131 | Serial.begin(9600); 132 | 133 | init_leds(); 134 | init_relays(); 135 | init_buttons(); 136 | 137 | 138 | servos[1].attach(SERVO1); 139 | servos[1].write(90); 140 | servos[2].attach(SERVO2); 141 | servos[2].write(90); 142 | servos[3].attach(SERVO3); 143 | servos[3].write(90); 144 | 145 | 146 | b1 = digitalRead(BUTTON1); 147 | b2 = digitalRead(BUTTON2); 148 | b3 = digitalRead(BUTTON3); 149 | c = 0; 150 | } 151 | 152 | void loop() 153 | { 154 | byte err; 155 | byte idle; 156 | static byte count = 0; 157 | byte msg[4]; 158 | long touchcount; 159 | 160 | if (1) { 161 | for(int i=0;i<4;i++){ 162 | int tmp = Serial.read(); 163 | if(tmp==0xff){ 164 | //sync bit 165 | len=0; 166 | msg[0]=tmp; 167 | }else if(tmp>=0x0 && len>-1){ 168 | len++; 169 | msg[len]=tmp; 170 | } 171 | if(len==4){ 172 | break; 173 | } 174 | } 175 | int i; 176 | byte b; 177 | uint16_t val; 178 | int x, y; 179 | char c0; 180 | 181 | if (len == 4) { 182 | len=-1; 183 | // assumes only one command per packet 184 | if (msg[1] == 0x2) { 185 | if (msg[2] == 0x0) 186 | analogWrite(LED1_RED, 255 - msg[3]); 187 | else if (msg[2] == 0x1) 188 | analogWrite(LED1_GREEN, 255 - msg[3]); 189 | else if (msg[2] == 0x2) 190 | analogWrite(LED1_BLUE, 255 - msg[3]); 191 | else if (msg[2] == 0x3) 192 | analogWrite(LED2_RED, 255 - msg[3]); 193 | else if (msg[2] == 0x4) 194 | analogWrite(LED2_GREEN, 255 - msg[3]); 195 | else if (msg[2] == 0x5) 196 | analogWrite(LED2_BLUE, 255 - msg[3]); 197 | else if (msg[2] == 0x6) 198 | analogWrite(LED3_RED, 255 - msg[3]); 199 | else if (msg[2] == 0x7) 200 | analogWrite(LED3_GREEN, 255 - msg[3]); 201 | else if (msg[2] == 0x8) 202 | analogWrite(LED3_BLUE, 255 - msg[3]); 203 | else if (msg[2] == 0x10) 204 | servos[1].write(map(msg[3], 0, 255, 0, 180)); 205 | else if (msg[2] == 0x11) 206 | servos[2].write(map(msg[3], 0, 255, 0, 180)); 207 | else if (msg[2] == 0x12) 208 | servos[3].write(map(msg[3], 0, 255, 0, 180)); 209 | } else if (msg[1] == 0x3) { 210 | if (msg[2] == 0x0) 211 | digitalWrite(RELAY1, msg[3] ? HIGH : LOW); 212 | else if (msg[2] == 0x1) 213 | digitalWrite(RELAY2, msg[3] ? HIGH : LOW); 214 | } 215 | } 216 | 217 | msg[0] = 0xff; 218 | msg[1] = 0x1; 219 | 220 | b = digitalRead(BUTTON1); 221 | if (b != b1) { 222 | msg[2] = 0; 223 | msg[3] = b ? 0 : 1; 224 | Serial.write(msg, 3); 225 | b1 = b; 226 | } 227 | 228 | b = digitalRead(BUTTON2); 229 | if (b != b2) { 230 | msg[2] = 1; 231 | msg[3] = b ? 0 : 1; 232 | Serial.write(msg, 3); 233 | b2 = b; 234 | } 235 | 236 | b = digitalRead(BUTTON3); 237 | if (b != b3) { 238 | msg[2] = 2; 239 | msg[3] = b ? 0 : 1; 240 | Serial.write(msg, 3); 241 | b3 = b; 242 | } 243 | 244 | 245 | switch (count++ % 0x10) { 246 | case 0: 247 | val = analogRead(TEMP_SENSOR); 248 | msg[1] = 0x4; 249 | msg[2] = val >> 8; 250 | msg[3] = val & 0xff; 251 | Serial.write(msg, 3); 252 | break; 253 | 254 | case 0x4: 255 | val = analogRead(LIGHT_SENSOR); 256 | msg[1] = 0x5; 257 | msg[2] = val >> 8; 258 | msg[3] = val & 0xff; 259 | Serial.write(msg, 3); 260 | break; 261 | 262 | 263 | case 0xc: 264 | c0 = touchcount > 750; 265 | 266 | if (c0 != c) { 267 | msg[1] = 0x1; 268 | msg[2] = 3; 269 | msg[3] = c0; 270 | Serial.write(msg, 3); 271 | c = c0; 272 | } 273 | 274 | break; 275 | } 276 | } else { 277 | // reset outputs to default values on disconnect 278 | analogWrite(LED1_RED, 255); 279 | analogWrite(LED1_GREEN, 255); 280 | analogWrite(LED1_BLUE, 255); 281 | analogWrite(LED2_RED, 255); 282 | analogWrite(LED2_GREEN, 255); 283 | analogWrite(LED2_BLUE, 255); 284 | analogWrite(LED3_RED, 255); 285 | analogWrite(LED3_GREEN, 255); 286 | analogWrite(LED3_BLUE, 255); 287 | servos[1].write(90); 288 | servos[1].write(90); 289 | servos[1].write(90); 290 | digitalWrite(RELAY1, LOW); 291 | digitalWrite(RELAY2, LOW); 292 | } 293 | 294 | delay(10); 295 | } 296 | 297 | 298 | int main(void) 299 | { 300 | init(); 301 | 302 | setup(); 303 | 304 | for (;;) 305 | loop(); 306 | 307 | return 0; 308 | } 309 | 310 | -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/iOS_ADK.cpp.eep: -------------------------------------------------------------------------------- 1 | :00000001FF 2 | -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/iOS_ADK.cpp.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/iOS_ADK.cpp.elf -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/iOS_ADK.cpp.hex: -------------------------------------------------------------------------------- 1 | :100000000C9464000C948C000C948C000C948C0068 2 | :100010000C948C000C948C000C948C000C948C0030 3 | :100020000C948C000C948C000C948C000C944D035C 4 | :100030000C948C000C948C000C948C000C948C0010 5 | :100040000C94B9060C948C000C94A4080C948C00AD 6 | :100050000C948C000C948C000C948C000C948C00F0 7 | :100060000C948F000C948C000000000024002700EA 8 | :100070002A0000000000250028002B0000000000DE 9 | :1000800023002600290004040404040404040202DA 10 | :100090000202020203030303030301020408102007 11 | :1000A0004080010204081020010204081020000012 12 | :1000B0000007000201000003040600000000000029 13 | :1000C00000008E000A04150A11241FBECFEFD8E0ED 14 | :1000D000DEBFCDBF11E0A0E0B1E0ECECF6E102C084 15 | :1000E00005900D92AC30B107D9F711E0ACE0B1E06A 16 | :1000F00001C01D92A43FB107E1F710E0C8ECD0E0C9 17 | :1001000004C02297FE010E94600BC23CD107C9F7D0 18 | :100110000E94B2060C94640B0C94000008951F9288 19 | :100120000F920FB60F9211242F933F934F935F932B 20 | :100130006F937F938F939F93AF93BF93EF93FF93AF 21 | :100140008091B90090E0887F90708036910509F425 22 | :10015000E2C081369105CCF58832910509F47BC067 23 | :1001600089329105B4F48031910509F46FC0813171 24 | :1001700091053CF4009709F438C1089709F040C193 25 | :1001800065C08831910509F466C0809709F038C1CF 26 | :100190007FC08034910509F4A3C08134910544F4F3 27 | :1001A0008033910509F47FC0C89709F029C186C042 28 | :1001B0008035910509F486C08835910509F495C00C 29 | :1001C0008834910509F01CC19EC08839910509F455 30 | :1001D00004C189399105ECF48837910509F49BC075 31 | :1001E000893791054CF48836910509F494C080371D 32 | :1001F000910509F005C18FC08838910509F4EDC05B 33 | :100200008039910509F48DC08038910509F0F8C056 34 | :1002100088C0803B910509F4B2C0813B91054CF444 35 | :10022000803A910509F491C0883A910509F0E8C037 36 | :10023000A6C0803C910509F4D4C0883C910509F41E 37 | :10024000D0C0883B910509F0DBC0B1C080910D01A1 38 | :100250008093BB00C0C09091140180911501981744 39 | :1002600078F490911401E0911201F0911301E90FDB 40 | :10027000F11D80818093BB009F5F90931401ABC000 41 | :1002800085ED8093BC008091BC0084FDFCCFB6C09E 42 | :1002900080E280931D0185ED8093BC008091BC00BD 43 | :1002A00084FDFCCFABC080E380931D0185ED80937E 44 | :1002B000BC008091BC0084FDFCCFA0C088E380938B 45 | :1002C0001D018FC0809114019091BB00E09112013B 46 | :1002D000F0911301E80FF11D90838F5F809314015B 47 | :1002E000909114018091150174C080911401909136 48 | :1002F000BB00E0911201F0911301E80FF11D908312 49 | :100300008F5F8093140185ED8093BC008091BC00C9 50 | :1003100084FDFCCF73C083E080930C0110921C011C 51 | :100320005AC080911C01803208F057C080911C0196 52 | :100330009091BB00E0911A01F0911B01E80FF11DB3 53 | :1003400090838F5F80931C0146C080911C01803296 54 | :1003500048F480911C01E0911A01F0911B01E80F13 55 | :10036000F11D108260911C01E0911001F0911101CA 56 | :1003700080911A0190911B0170E0099532C084E0D0 57 | :1003800080930C011092180110921901E0910E0156 58 | :10039000F0910F01099580911901882341F481E0C2 59 | :1003A00080931901E0911601F0911701108290914C 60 | :1003B0001801E0911601F0911701E90FF11D8081FC 61 | :1003C0008093BB009F5F90931801909118018091DA 62 | :1003D0001901981710F485EC01C085E88093BC00E2 63 | :1003E0000FC085EC8093BC0009C010921D0185ED03 64 | :1003F0008093BC008091BC0084FDFCCF10920C0166 65 | :10040000FF91EF91BF91AF919F918F917F916F91EC 66 | :100410005F914F913F912F910F900FBE0F901F90C2 67 | :100420001895FC0180911E018C3090F480838F5FC1 68 | :1004300080931E01815090E0FC01EE0FFF1FE80F3A 69 | :10044000F91FE15EFE4F8CED95E092838183089564 70 | :100450008FEF80830895FC0130813C3078F58181F5 71 | :10046000992787FD909548E850E0481B590B440FA9 72 | :10047000551F440F551F6417750784F08281992713 73 | :1004800087FD909548E552E0481B590B440F551FD6 74 | :10049000440F551F641775070CF4AB012FB7F89480 75 | :1004A000832F90E0FC01EE0FFF1FE80FF91FE15EC4 76 | :1004B000FE4F46505040528341832FBF0895AF9264 77 | :1004C000BF92CF92DF92EF92FF920F931F93CF9341 78 | :1004D000DF93EC019B0182E0603278070CF048C0AA 79 | :1004E00077FF03C020E030E005C0653B710514F0E4 80 | :1004F00024EB30E000D000D0B901882777FD80954B 81 | :10050000982F2981332727FD3095B8E8AB2EB12CE1 82 | :10051000A21AB30AAA0CBB1CAA0CBB1CCC24B7FCA5 83 | :10052000C094DC2CEA81FF27E7FDF09528E532E056 84 | :100530002E1B3F0B220F331F220F331F442737FD83 85 | :100540004095542FEDB7FEB7218332834383548304 86 | :1005500020E030E040E050E0E4EBEE2EF12C012D05 87 | :10056000112D0E94860A9B010F900F900F900F9003 88 | :10057000CE01B9010E942B02DF91CF911F910F9103 89 | :10058000FF90EF90DF90CF90BF90AF900895CF9203 90 | :10059000DF92EF92FF921F93CF93DF93EC01162F20 91 | :1005A0007A01690188818C3008F064C0862F61E08F 92 | :1005B0000E94E807888190E0FC01EE0FFF1FE80F22 93 | :1005C000F91FE15EFE4F1F738081807C812B808349 94 | :1005D00080E292E08E199F0964E070E00E94FA0ABE 95 | :1005E000698380E699E08C199D0964E070E00E94BF 96 | :1005F000FA0A6A83A8818A2F6CE00E94EE0A682FAB 97 | :1006000070E0AB01440F551F460F571F440F551F95 98 | :10061000440F551F20E030E0C901840F951FFC01F5 99 | :10062000EE0FFF1FE80FF91FE15EFE4F808186FD90 100 | :1006300015C02F5F3F4F2C30310571F724C0109249 101 | :10064000800082E0809381001092850010928400E7 102 | :10065000B19A80916F00826080936F008A2F90E042 103 | :10066000FC01EE0FFF1FE80FF91FE15EFE4F8081D6 104 | :10067000806480838881DF91CF911F91FF90EF90FC 105 | :10068000DF90CF900895672BD1F2E8CF40E252E09F 106 | :1006900020E639E00E94C70208951F920F920FB61C 107 | :1006A0000F9211242F933F934F935F936F937F93F8 108 | :1006B0008F939F93AF93BF93EF93FF9380914301E9 109 | :1006C00087FF05C010928500109284002BC02091F6 110 | :1006D0004301332727FD309580911E0190E02817B4 111 | :1006E000390704F580914301992787FD9095FC0116 112 | :1006F000EE0FFF1FE80FF91FE15EFE4F808186FFBE 113 | :1007000011C080914301992787FD9095FC01EE0F60 114 | :10071000FF1FE80FF91FE15EFE4F80818F7360E0DD 115 | :100720000E940808809143018F5F809343012091CC 116 | :100730004301332727FD309580911E0190E0281753 117 | :1007400039070CF04EC0809143018C300CF049C049 118 | :10075000209184003091850080914301992787FD85 119 | :100760009095FC01EE0FFF1FE80FF91FE15EFE4FB1 120 | :1007700081819281280F391F30938900209388004E 121 | :1007800080914301992787FD9095FC01EE0FFF1F93 122 | :10079000E80FF91FE15EFE4F808186FF2AC080913D 123 | :1007A0004301992787FD9095FC01EE0FFF1FE80F8D 124 | :1007B000F91FE15EFE4F80818F7361E00E9408089F 125 | :1007C00018C080E29EE405C080918400909185006D 126 | :1007D000049690938900809388008FEF8093430163 127 | :1007E00008C0809184009091850084529E4448F313 128 | :1007F000EBCFFF91EF91BF91AF919F918F917F913F 129 | :100800006F915F914F913F912F910F900FBE0F907D 130 | :100810001F9018950F931F9304E411E0C8010E94E4 131 | :100820001102C80103960E941102C80106960E9497 132 | :1008300011021F910F910895AF92BF92CF92DF9254 133 | :10084000EF92FF920F931F93DF93CF9300D000D0CE 134 | :10085000CDB7DEB700E010E07E010894E11CF11C8A 135 | :10086000DD24DA9481EE91E00E94DA098F3F910550 136 | :1008700031F410924E0110924D01D98210C097FDB3 137 | :100880000EC0E0914D01F0914E01F7FD08C0319688 138 | :10089000F0934E01E0934D01EE0DFF1D808380919A 139 | :1008A0004D0190914E01049729F00F5F1F4F0430C6 140 | :1008B0001105C1F680914D0190914E01049709F008 141 | :1008C000F1C08FEF9FEF90934E0180934D018A818D 142 | :1008D000823009F0D3C08B81882339F48C816FEF8B 143 | :1008E00070E0681B710988E008C0813049F48C8190 144 | :1008F0006FEF70E0681B710982E10E948F07D2C020 145 | :10090000823039F48C816FEF70E0681B710989E0E7 146 | :10091000F4CF833039F48C816FEF70E0681B71097C 147 | :1009200085E0EBCF843039F48C816FEF70E0681B89 148 | :10093000710987E0E2CF853039F48C816FEF70E088 149 | :10094000681B710986E0D9CF863039F48C816FEF4E 150 | :1009500070E0681B710982E0D0CF873039F48C8158 151 | :100960006FEF70E0681B710984E0C7CF883039F4FD 152 | :100970008C816FEF70E0681B710983E0BECF80311E 153 | :1009800039F500D000D06C8170E080E090E024EB7D 154 | :1009900030E040E050E0EDB7FEB72183328343837F 155 | :1009A000548320E030E040E050E0AFEFEA2EF12C3D 156 | :1009B000012D112DAA24BB2465010E94860A9B01EA 157 | :1009C000AC010F900F900F900F9087E491E052C010 158 | :1009D000813139F500D000D06C8170E080E090E08A 159 | :1009E00024EB30E040E050E0EDB7FEB721833283E6 160 | :1009F0004383548320E030E040E050E0FFEFEF2EEF 161 | :100A0000F12C012D112DAA24BB2465010E94860A18 162 | :100A10009B01AC010F900F900F900F908AE491E032 163 | :100A200029C0823109F03EC000D000D06C8170E056 164 | :100A300080E090E024EB30E040E050E0EDB7FEB71E 165 | :100A4000218332834383548320E030E040E050E050 166 | :100A5000EFEFEE2EF12C012D112DAA24BB24650100 167 | :100A60000E94860A9B01AC010F900F900F900F908F 168 | :100A70008DE491E0B9010E945F0214C0833091F4CB 169 | :100A80008B81882331F460E08C81811161E08EE0FC 170 | :100A900007C0813039F460E08C81811161E08FE022 171 | :100AA0000E9408088FEF898301E00A838AE00E9490 172 | :100AB0005508182F80914F01181781F01B821C8256 173 | :100AC000112309F40C8381EE91E0BE016F5F7F4F2B 174 | :100AD00043E050E00E94670A10934F0183E10E94B7 175 | :100AE0005508182F80915001181789F081E08B83E9 176 | :100AF0001C82112309F48C8381EE91E0BE016F5FAB 177 | :100B00007F4F43E050E00E94670A1093500184E158 178 | :100B10000E945508182F80915101181791F082E01A 179 | :100B20008B831C82112311F481E08C8381EE91E090 180 | :100B3000BE016F5F7F4F43E050E00E94670A109351 181 | :100B40005101809153018F5F80935301815090E058 182 | :100B50008F7090708430910551F08C309105C1F008 183 | :100B6000892B89F581E10E94710724E004C080E1AE 184 | :100B70000E94710725E02A839B838C8381EE91E09C 185 | :100B8000BE016F5F7F4F43E050E00E94670A1BC0C9 186 | :100B900010E0212F332727FD30958091520190E0FE 187 | :100BA0002817390781F081E08A8383E08B831C83D7 188 | :100BB00081EE91E0BE016F5F7F4F43E050E00E9405 189 | :100BC000670A109352016AE070E080E090E00E94B2 190 | :100BD0000D070F900F900F900F90CF91DF911F9105 191 | :100BE0000F91FF90EF90DF90CF90BF90AF9008955E 192 | :100BF00088E061E00E94080882E161E00E94080844 193 | :100C000089E061E00E94080888E061E00E94E8074E 194 | :100C100082E161E00E94E80789E061E00E94E80764 195 | :100C200085E061E00E94080887E061E00E94080812 196 | :100C300086E061E00E94080885E061E00E94E80724 197 | :100C400087E061E00E94E80786E061E00E94E80733 198 | :100C500082E061E00E94080884E061E00E940808E8 199 | :100C600083E061E00E94080882E061E00E94E807FA 200 | :100C700084E061E00E94E80783E061E00E94E80709 201 | :100C800008958EE061E00E94E8078FE061E00E9435 202 | :100C9000E80708958AE060E00E94E80783E160E0E9 203 | :100CA0000E94E80784E160E00E94E8078AE061E0D2 204 | :100CB0000E94080883E161E00E94080884E161E085 205 | :100CC0000E9408080895EF92FF920F931F9381EE00 206 | :100CD00091E040E855E260E070E00E94E1080E9487 207 | :100CE000F8050E9441060E944A0607E411E0C80187 208 | :100CF0006BE070E00E944603C8016AE570E00E9464 209 | :100D00005F02B3E0EB2EF12CE00EF11EC7016CE0A8 210 | :100D100070E00E944603C7016AE570E00E945F022E 211 | :100D20000A5F1F4FC8016DE070E00E944603C801D2 212 | :100D30006AE570E00E945F028AE00E945508809395 213 | :100D40004F0183E10E9455088093500184E10E9485 214 | :100D5000550880935101109252011F910F91FF90FD 215 | :100D6000EF9008950E9437070E9463060E941C04BA 216 | :100D7000FDCF1F920F920FB60F9211242F933F9326 217 | :100D80004F935F936F937F938F939F93AF93BF9393 218 | :100D9000209158013091590140915A0150915B01C5 219 | :100DA00070915C01DA01C9010296A11DB11D672F86 220 | :100DB0006A5F6D3730F06D57DA01C9010396A11DE6 221 | :100DC000B11D60935C018093580190935901A093E9 222 | :100DD0005A01B0935B018091540190915501A0910B 223 | :100DE0005601B09157010196A11DB11D8093540188 224 | :100DF00090935501A0935601B0935701BF91AF91C5 225 | :100E00009F918F917F916F915F914F913F912F9122 226 | :100E10000F900FBE0F901F901895EF92FF920F93B7 227 | :100E20001F937B018C018FB7F8944091580150912A 228 | :100E3000590160915A0170915B018FBF2FB7F894EF 229 | :100E40008091580190915901A0915A01B0915B0194 230 | :100E50002FBF841B950BA60BB70BE816F9060A07E4 231 | :100E60001B0760F71F910F91FF90EF900895789402 232 | :100E700084B5826084BD84B5816084BD85B582609F 233 | :100E800085BD85B5816085BDEEE6F0E0808181603D 234 | :100E90008083E1E8F0E080818260808380818160EE 235 | :100EA0008083E0E8F0E0808181608083E1EBF0E026 236 | :100EB000808184608083E0EBF0E0808181608083CA 237 | :100EC000EAE7F0E0808184608083808182608083B3 238 | :100ED0008081816080838081806880831092C100DE 239 | :100EE00008958F70909100019295990F990F907CC1 240 | :100EF000982B90937C0080917A00806480937A0094 241 | :100F000080917A0086FDFCCF209178004091790095 242 | :100F1000942F80E030E0282B392BC90108951F93CE 243 | :100F2000CF93DF93182FEB0161E00E94E807E12FD8 244 | :100F3000F0E0E255FF4F8491833051F480918000BE 245 | :100F4000806880938000D0938900C09388003CC063 246 | :100F5000843051F480918000806280938000D0932F 247 | :100F60008B00C0938A0030C0813039F4209729F17A 248 | :100F700084B5806884BDC7BD27C0823039F420970E 249 | :100F8000E1F084B5806284BDC8BD1EC0863041F4E6 250 | :100F90008091B00080688093B000C093B30014C00B 251 | :100FA000873041F48091B00080628093B000C0939C 252 | :100FB000B4000AC0C038D1051CF4812F60E002C023 253 | :100FC000812F61E00E940808DF91CF911F91089561 254 | :100FD000282F30E0C90186569F4FFC0194912A5773 255 | :100FE0003F4FF9018491882391F0E82FF0E0EE0F54 256 | :100FF000FF1FE859FF4FA591B491662329F48C9106 257 | :10100000909589238C9308958C91892B8C930895C6 258 | :10101000482F50E0CA0182559F4FFC012491CA011C 259 | :1010200086569F4FFC0194914A575F4FFA013491C5 260 | :101030003323D1F1222331F1233021F48091800038 261 | :101040008F7705C0243031F4809180008F7D8093AC 262 | :10105000800018C0213019F484B58F7704C0223085 263 | :1010600021F484B58F7D84BD0DC0263021F480919C 264 | :10107000B0008F7705C0273029F48091B0008F7DB4 265 | :101080008093B000E32FF0E0EE0FFF1FEE58FF4F0C 266 | :10109000A591B491662329F48C91909589238C9322 267 | :1010A00008958C91892B8C930895682F70E0CB0163 268 | :1010B00082559F4FFC012491CB0186569F4FFC0126 269 | :1010C00044916A577F4FFB019491992319F420E0D2 270 | :1010D00030E038C0222331F1233021F480918000A8 271 | :1010E0008F7705C0243031F4809180008F7D80930C 272 | :1010F000800018C0213019F484B58F7704C02230E5 273 | :1011000021F484B58F7D84BD0DC0263021F48091FB 274 | :10111000B0008F7705C0273029F48091B0008F7D13 275 | :101120008093B000892F90E0880F991F84589F4FBB 276 | :10113000FC01A591B4918C9120E030E0842311F062 277 | :1011400021E030E0C90108951F920F920FB60F926F 278 | :1011500011242F933F934F935F936F937F938F93BC 279 | :101160009F93AF93BF93EF93FF934091C600E0919D 280 | :10117000DD01F091DE01CF01019660E870E00E9490 281 | :10118000FA0A9C018091DF019091E001281739074C 282 | :1011900039F0E35AFE4F40833093DE012093DD01A6 283 | :1011A000FF91EF91BF91AF919F918F917F916F913F 284 | :1011B0005F914F913F912F910F900FBE0F901F9015 285 | :1011C00018955F926F927F928F929F92AF92BF928B 286 | :1011D000CF92DF92EF92FF920F931F93CF93DF9303 287 | :1011E000EC013A014B01413281EA580787E0680778 288 | :1011F00080E078070CF07FC060E472E48FE090E05C 289 | :10120000A40193010E942F0B2150304040405040D8 290 | :10121000CA01B90122E030E040E050E00E942F0B0B 291 | :1012200059016A01A6019501209530954095509588 292 | :1012300094E0220F331F441F551F9A95D1F760E0A9 293 | :1012400072E18AE790E00E942F0BCA01B9012FEFEB 294 | :1012500030E040E050E00E94CF0AA40193010E94D8 295 | :101260002F0BC90181509F4F181619061CF4522EDE 296 | :101270005A9403C055245394521A60E874E88EE1DE 297 | :1012800090E0A40193010E942F0B21503040404078 298 | :101290005040CA01B90122E030E040E050E00E9435 299 | :1012A0002F0B209530954095509583E0220F331FEA 300 | :1012B000441F551F8A95D1F760E072E18AE790E0FC 301 | :1012C0000E942F0BCA01B9012FEF30E040E050E03F 302 | :1012D0000E94CF0AA40193010E942F0BC9018150E3 303 | :1012E0009F4F181619061CF4822F815002C081E00E 304 | :1012F000821B851500F5E885F98581E090E00A8874 305 | :1013000002C0880F991F0A94E2F7808360E874E8AE 306 | :101310008EE190E0A40193010E942F0B21503040F8 307 | :1013200040405040CA01B90122E030E040E050E0C6 308 | :101330000E942F0B04C0E885F98510829501EC818D 309 | :10134000FD813083EE81FF812083EA85FB8520814A 310 | :1013500041E050E0CA010E8402C0880F991F0A9430 311 | :10136000E2F7282B2083EA85FB852081CA010F84C0 312 | :1013700002C0880F991F0A94E2F7282B2083EA8580 313 | :10138000FB858081088802C0440F551F0A94E2F74C 314 | :10139000842B8083DF91CF911F910F91FF90EF906D 315 | :1013A000DF90CF90BF90AF909F908F907F906F9085 316 | :1013B0005F900895CF93DF93DC011296ED91FC913D 317 | :1013C0001397EF01CE57DF4F48815981E058FF4F07 318 | :1013D00080819181E058F0408417950719F42FEF30 319 | :1013E0003FEF0CC0E40FF51F2081CA01019660E8B1 320 | :1013F00070E00E94FA0A9983888330E0C901DF9186 321 | :10140000CF910895FC01A085B18521898C9190E050 322 | :10141000022E02C0959587950A94E2F780FFF6CFD9 323 | :101420000484F585E02D6083089585E091E0909334 324 | :10143000E2018093E1018DE591E09093E4018093D6 325 | :10144000E30185EC90E09093E6018093E50184EC64 326 | :1014500090E09093E8018093E70180EC90E0909316 327 | :10146000EA018093E90181EC90E09093EC01809394 328 | :10147000EB0186EC90E09093EE018093ED0184E027 329 | :101480008093EF0183E08093F00187E08093F10186 330 | :1014900085E08093F20181E08093F30108950F933A 331 | :1014A0001F93CF93DF938C01EB0109C02196D801E4 332 | :1014B000ED91FC910190F081E02DC80109956881C2 333 | :1014C0006623A1F7DF91CF911F910F910895EF92BD 334 | :1014D000FF920F931F93CF93DF938C017B01EA015F 335 | :1014E0000CC0D7016D917D01D801ED91FC91019067 336 | :1014F000F081E02DC80109952197209791F7DF91A0 337 | :10150000CF911F910F91FF90EF9008952F923F92EE 338 | :101510004F925F926F927F928F929F92AF92BF9203 339 | :10152000CF92DF92EF92FF920F931F93DF93CF93AF 340 | :10153000CDB7DEB73B014C0119012A016D897E89C7 341 | :101540008F89988D6A197B098C099D09621A730A23 342 | :10155000840A950AA40193010E94CF0AE218F308B5 343 | :1015600004091509A80197010E942F0B2A0D3B1DA4 344 | :101570004C1D5D1DB901CA01CF91DF911F910F91E3 345 | :10158000FF90EF90DF90CF90BF90AF909F908F90A3 346 | :101590007F906F905F904F903F902F900895629F43 347 | :1015A000D001739FF001829FE00DF11D649FE00D5B 348 | :1015B000F11D929FF00D839FF00D749FF00D659FBC 349 | :1015C000F00D9927729FB00DE11DF91F639FB00DBB 350 | :1015D000E11DF91FBD01CF0111240895991B79E088 351 | :1015E00004C0991F961708F0961B881F7A95C9F7B3 352 | :1015F0008095089597FB092E07260AD077FD04D021 353 | :1016000049D006D000201AF4709561957F4F089557 354 | :10161000F6F7909581959F4F0895A1E21A2EAA1B87 355 | :10162000BB1BFD010DC0AA1FBB1FEE1FFF1FA21792 356 | :10163000B307E407F50720F0A21BB30BE40BF50B8F 357 | :10164000661F771F881F991F1A9469F76095709518 358 | :10165000809590959B01AC01BD01CF01089597FB4A 359 | :10166000092E05260ED057FD04D0D7DF0AD0001C66 360 | :1016700038F450954095309521953F4F4F4F5F4F2F 361 | :101680000895F6F790958095709561957F4F8F4FEF 362 | :101690009F4F0895AA1BBB1B51E107C0AA1FBB1F88 363 | :1016A000A617B70710F0A61BB70B881F991F5A95EE 364 | :1016B000A9F780959095BC01CD010895EE0FFF1F0D 365 | :0C16C0000590F491E02D0994F894FFCF00 366 | :0C16CC000100000000020A4F0A670A003B 367 | :00000001FF 368 | -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/iOS_ADK.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/iOS_ADK.cpp.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/pins_arduino.c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/pins_arduino.c.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/wiring.c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/wiring.c.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/wiring_analog.c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/wiring_analog.c.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/wiring_digital.c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/wiring_digital.c.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/wiring_pulse.c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/wiring_pulse.c.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/applet/wiring_shift.c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Arduino(iOS ADK sample)/iOS_ADK/applet/wiring_shift.c.o -------------------------------------------------------------------------------- /Arduino(iOS ADK sample)/iOS_ADK/iOS_ADK.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * SerialCommunication.framework for iOS 3 | * iOS_ADK 4 | * 5 | * Copyright (c) Yusuke Sekikawa, 11/06/02 6 | * All rights reserved. 7 | * 8 | * BSD License 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, are 11 | * permitted provided that the following conditions are met: 12 | * - Redistributions of source code must retain the above copyright notice, this list of 13 | * conditions and the following disclaimer. 14 | * - Redistributions in binary form must reproduce the above copyright notice, this list 15 | * of conditions and the following disclaimer in the documentation and/or other materia 16 | * ls provided with the distribution. 17 | * - Neither the name of the "Yusuke Sekikawa" nor the names of its contributors may be u 18 | * sed to endorse or promote products derived from this software without specific prior 19 | * written permission. 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY E 21 | * XPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES O 22 | * F MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SH 23 | * ALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENT 24 | * AL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROC 25 | * UREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS I 26 | * NTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI 27 | * CT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF T 28 | * HE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #define LED3_RED 2 38 | #define LED3_GREEN 4 39 | #define LED3_BLUE 3 40 | 41 | #define LED2_RED 5 42 | #define LED2_GREEN 7 43 | #define LED2_BLUE 6 44 | 45 | #define LED1_RED 8 46 | //#define LED1_GREEN 18 47 | #define LED1_GREEN 10 48 | #define LED1_BLUE 9 49 | 50 | #define SERVO1 11 51 | #define SERVO2 12 52 | #define SERVO3 13 53 | 54 | 55 | #if 0 56 | //Case Arduino Pro mini or something like that. 57 | #define RELAY1 14 58 | #define RELAY2 15 59 | #define LIGHT_SENSOR 16 60 | #define TEMP_SENSOR 17 61 | #define BUTTON1 18 62 | #define BUTTON2 19 63 | #define BUTTON3 20 64 | #else 65 | //Case Arduino Mega,Android NDK or somethig like that. 66 | #define TOUCH_RECV 14 67 | #define TOUCH_SEND 15 68 | #define RELAY1 A0 69 | #define RELAY2 A1 70 | #define LIGHT_SENSOR A2 71 | #define TEMP_SENSOR A3 72 | #define BUTTON1 A6 73 | #define BUTTON2 A7 74 | #define BUTTON3 A8 75 | #define JOY_SWITCH A9 // pulls line down when pressed 76 | #define JOY_nINT A10 // active low interrupt input 77 | #define JOY_nRESET A11 // active low reset output 78 | #endif 79 | 80 | 81 | 82 | 83 | Servo servos[3]; 84 | CapSense touch_robot = CapSense(TOUCH_SEND, TOUCH_RECV); 85 | int len = -1;//byte recieved 86 | 87 | 88 | void setup(); 89 | void loop(); 90 | 91 | void init_buttons() 92 | { 93 | pinMode(BUTTON1, INPUT); 94 | pinMode(BUTTON2, INPUT); 95 | pinMode(BUTTON3, INPUT); 96 | 97 | // enable the internal pullups 98 | digitalWrite(BUTTON1, HIGH); 99 | digitalWrite(BUTTON2, HIGH); 100 | digitalWrite(BUTTON3, HIGH); 101 | } 102 | 103 | 104 | void init_relays() 105 | { 106 | pinMode(RELAY1, OUTPUT); 107 | pinMode(RELAY2, OUTPUT); 108 | } 109 | 110 | 111 | void init_leds() 112 | { 113 | digitalWrite(LED1_RED, 1); 114 | digitalWrite(LED1_GREEN, 1); 115 | digitalWrite(LED1_BLUE, 1); 116 | 117 | pinMode(LED1_RED, OUTPUT); 118 | pinMode(LED1_GREEN, OUTPUT); 119 | pinMode(LED1_BLUE, OUTPUT); 120 | 121 | digitalWrite(LED2_RED, 1); 122 | digitalWrite(LED2_GREEN, 1); 123 | digitalWrite(LED2_BLUE, 1); 124 | 125 | pinMode(LED2_RED, OUTPUT); 126 | pinMode(LED2_GREEN, OUTPUT); 127 | pinMode(LED2_BLUE, OUTPUT); 128 | 129 | digitalWrite(LED3_RED, 1); 130 | digitalWrite(LED3_GREEN, 1); 131 | digitalWrite(LED3_BLUE, 1); 132 | 133 | pinMode(LED3_RED, OUTPUT); 134 | pinMode(LED3_GREEN, OUTPUT); 135 | pinMode(LED3_BLUE, OUTPUT); 136 | } 137 | 138 | void init_joystick(int threshold); 139 | 140 | byte b1, b2, b3, b4, c; 141 | void setup() 142 | { 143 | Serial.begin(9600); 144 | 145 | init_leds(); 146 | init_relays(); 147 | init_buttons(); 148 | init_joystick( 5 ); 149 | 150 | touch_robot.set_CS_AutocaL_Millis(0xFFFFFFFF); 151 | 152 | servos[0].attach(SERVO1); 153 | servos[0].write(90); 154 | servos[1].attach(SERVO2); 155 | servos[1].write(90); 156 | servos[2].attach(SERVO3); 157 | servos[2].write(90); 158 | 159 | 160 | b1 = digitalRead(BUTTON1); 161 | b2 = digitalRead(BUTTON2); 162 | b3 = digitalRead(BUTTON3); 163 | c = 0; 164 | } 165 | 166 | void loop() 167 | { 168 | byte err; 169 | byte idle; 170 | static byte count = 0; 171 | byte msg[4]; 172 | long touchcount; 173 | 174 | if (1) { 175 | for(int i=0;i<4;i++){ 176 | int tmp = Serial.read(); 177 | if(tmp==0xff && len==-1){ 178 | //sync bit 179 | len=0; 180 | msg[0]=0xff; 181 | }else if(tmp>=0x0 && len!=-1){ 182 | len++; 183 | msg[len]=tmp; 184 | } 185 | if(len==3){ 186 | break; 187 | } 188 | } 189 | int i; 190 | byte b; 191 | uint16_t val; 192 | int x, y; 193 | char c0; 194 | 195 | if (len == 3) { 196 | len=-1; 197 | // assumes only one command per packet 198 | if (msg[1] == 0x2) { 199 | if (msg[2] == 0x0) 200 | analogWrite(LED1_RED, 255 - msg[3]); 201 | else if (msg[2] == 0x1) 202 | analogWrite(LED1_GREEN, 255 - msg[3]); 203 | else if (msg[2] == 0x2) 204 | analogWrite(LED1_BLUE, 255 - msg[3]); 205 | else if (msg[2] == 0x3) 206 | analogWrite(LED2_RED, 255 - msg[3]); 207 | else if (msg[2] == 0x4) 208 | analogWrite(LED2_GREEN, 255 - msg[3]); 209 | else if (msg[2] == 0x5) 210 | analogWrite(LED2_BLUE, 255 - msg[3]); 211 | else if (msg[2] == 0x6) 212 | analogWrite(LED3_RED, 255 - msg[3]); 213 | else if (msg[2] == 0x7) 214 | analogWrite(LED3_GREEN, 255 - msg[3]); 215 | else if (msg[2] == 0x8) 216 | analogWrite(LED3_BLUE, 255 - msg[3]); 217 | else if (msg[2] == 0x10) 218 | servos[0].write(map(msg[3], 0, 255, 0, 180)); 219 | else if (msg[2] == 0x11) 220 | servos[1].write(map(msg[3], 0, 255, 0, 180)); 221 | else if (msg[2] == 0x12) 222 | servos[2].write(map(msg[3], 0, 255, 0, 180)); 223 | } else if (msg[1] == 0x3) { 224 | if (msg[2] == 0x0) 225 | digitalWrite(RELAY1, msg[3] ? HIGH : LOW); 226 | else if (msg[2] == 0x1) 227 | digitalWrite(RELAY2, msg[3] ? HIGH : LOW); 228 | } 229 | } 230 | 231 | msg[0] = 0xff; 232 | msg[1] = 0x1; 233 | 234 | b = digitalRead(BUTTON1); 235 | if (b != b1) { 236 | msg[2] = 0; 237 | msg[3] = b ? 0 : 1; 238 | Serial.write(msg, 4); 239 | b1 = b; 240 | } 241 | 242 | b = digitalRead(BUTTON2); 243 | if (b != b2) { 244 | msg[2] = 1; 245 | msg[3] = b ? 0 : 1; 246 | Serial.write(msg, 4); 247 | b2 = b; 248 | } 249 | 250 | b = digitalRead(BUTTON3); 251 | if (b != b3) { 252 | msg[2] = 2; 253 | msg[3] = b ? 0 : 1; 254 | Serial.write(msg, 4); 255 | b3 = b; 256 | } 257 | b = digitalRead(JOY_SWITCH); 258 | if (b != b4) { 259 | msg[2] = 4; 260 | msg[3] = b ? 0 : 1; 261 | Serial.write(msg, 4); 262 | b4 = b; 263 | } 264 | 265 | 266 | switch (count++ % 0x10) { 267 | case 0: 268 | val = analogRead(TEMP_SENSOR); 269 | msg[1] = 0x4; 270 | msg[2] = val >> 8; 271 | msg[3] = val & 0xff; 272 | Serial.write(msg, 4); 273 | break; 274 | 275 | case 0x4: 276 | val = analogRead(LIGHT_SENSOR); 277 | msg[1] = 0x5; 278 | msg[2] = val >> 8; 279 | msg[3] = val & 0xff; 280 | Serial.write(msg, 4); 281 | break; 282 | 283 | case 0x8: 284 | read_joystick(&x, &y); 285 | msg[1] = 0x6; 286 | msg[2] = constrain(x, -128, 127); 287 | msg[3] = constrain(y, -128, 127); 288 | Serial.write(msg, 4); 289 | break; 290 | 291 | 292 | case 0xc: 293 | c0 = touchcount > 750; 294 | 295 | if (c0 != c) { 296 | msg[1] = 0x1; 297 | msg[2] = 3; 298 | msg[3] = c0; 299 | Serial.write(msg, 4); 300 | c = c0; 301 | } 302 | 303 | break; 304 | } 305 | } else { 306 | // reset outputs to default values on disconnect 307 | analogWrite(LED1_RED, 255); 308 | analogWrite(LED1_GREEN, 255); 309 | analogWrite(LED1_BLUE, 255); 310 | analogWrite(LED2_RED, 255); 311 | analogWrite(LED2_GREEN, 255); 312 | analogWrite(LED2_BLUE, 255); 313 | analogWrite(LED3_RED, 255); 314 | analogWrite(LED3_GREEN, 255); 315 | analogWrite(LED3_BLUE, 255); 316 | servos[1].write(90); 317 | servos[1].write(90); 318 | servos[1].write(90); 319 | digitalWrite(RELAY1, LOW); 320 | digitalWrite(RELAY2, LOW); 321 | } 322 | 323 | delay(10); 324 | } 325 | // ============================================================================== 326 | // Austria Microsystems i2c Joystick 327 | void init_joystick(int threshold) 328 | { 329 | byte status = 0; 330 | 331 | pinMode(JOY_SWITCH, INPUT); 332 | digitalWrite(JOY_SWITCH, HIGH); 333 | 334 | pinMode(JOY_nINT, INPUT); 335 | digitalWrite(JOY_nINT, HIGH); 336 | 337 | pinMode(JOY_nRESET, OUTPUT); 338 | 339 | digitalWrite(JOY_nRESET, 1); 340 | delay(1); 341 | digitalWrite(JOY_nRESET, 0); 342 | delay(1); 343 | digitalWrite(JOY_nRESET, 1); 344 | 345 | Wire.begin(); 346 | 347 | do { 348 | status = read_joy_reg(0x0f); 349 | } while ((status & 0xf0) != 0xf0); 350 | 351 | // invert magnet polarity setting, per datasheet 352 | write_joy_reg(0x2e, 0x86); 353 | 354 | calibrate_joystick(threshold); 355 | } 356 | 357 | 358 | int offset_X, offset_Y; 359 | 360 | void calibrate_joystick(int dz) 361 | { 362 | char iii; 363 | int x_cal = 0; 364 | int y_cal = 0; 365 | 366 | // Low Power Mode, 20ms auto wakeup 367 | // INTn output enabled 368 | // INTn active after each measurement 369 | // Normal (non-Reset) mode 370 | write_joy_reg(0x0f, 0x00); 371 | delay(1); 372 | 373 | // dummy read of Y_reg to reset interrupt 374 | read_joy_reg(0x11); 375 | 376 | for(iii = 0; iii != 16; iii++) { 377 | while(!joystick_interrupt()) {} 378 | 379 | x_cal += read_joy_reg(0x10); 380 | y_cal += read_joy_reg(0x11); 381 | } 382 | 383 | // divide by 16 to get average 384 | offset_X = -(x_cal>>4); 385 | offset_Y = -(y_cal>>4); 386 | 387 | write_joy_reg(0x12, dz - offset_X); // Xp, LEFT threshold for INTn 388 | write_joy_reg(0x13, -dz - offset_X); // Xn, RIGHT threshold for INTn 389 | write_joy_reg(0x14, dz - offset_Y); // Yp, UP threshold for INTn 390 | write_joy_reg(0x15, -dz - offset_Y); // Yn, DOWN threshold for INTn 391 | 392 | // dead zone threshold detect requested? 393 | if (dz) 394 | write_joy_reg(0x0f, 0x04); 395 | } 396 | 397 | 398 | void read_joystick(int *x, int *y) 399 | { 400 | *x = read_joy_reg(0x10) + offset_X; 401 | *y = read_joy_reg(0x11) + offset_Y; // reading Y clears the interrupt 402 | } 403 | <<<<<<< HEAD 404 | ======= 405 | 406 | char joystick_interrupt() 407 | { 408 | return digitalRead(JOY_nINT) == 0; 409 | } 410 | 411 | 412 | #define JOY_I2C_ADDR 0x40 413 | 414 | char read_joy_reg(char reg_addr) 415 | { 416 | char c; 417 | 418 | Wire.beginTransmission(JOY_I2C_ADDR); 419 | Wire.send(reg_addr); 420 | Wire.endTransmission(); 421 | 422 | Wire.requestFrom(JOY_I2C_ADDR, 1); 423 | 424 | while(Wire.available()) 425 | c = Wire.receive(); 426 | 427 | return c; 428 | } 429 | 430 | void write_joy_reg(char reg_addr, char val) 431 | { 432 | Wire.beginTransmission(JOY_I2C_ADDR); 433 | Wire.send(reg_addr); 434 | Wire.send(val); 435 | Wire.endTransmission(); 436 | } 437 | >>>>>>> Add remote access function. 438 | 439 | char joystick_interrupt() 440 | { 441 | return digitalRead(JOY_nINT) == 0; 442 | } 443 | 444 | 445 | #define JOY_I2C_ADDR 0x40 446 | 447 | char read_joy_reg(char reg_addr) 448 | { 449 | char c; 450 | 451 | Wire.beginTransmission(JOY_I2C_ADDR); 452 | Wire.send(reg_addr); 453 | Wire.endTransmission(); 454 | 455 | Wire.requestFrom(JOY_I2C_ADDR, 1); 456 | 457 | while(Wire.available()) 458 | c = Wire.receive(); 459 | 460 | return c; 461 | } 462 | 463 | void write_joy_reg(char reg_addr, char val) 464 | { 465 | Wire.beginTransmission(JOY_I2C_ADDR); 466 | Wire.send(reg_addr); 467 | Wire.send(val); 468 | Wire.endTransmission(); 469 | } 470 | 471 | -------------------------------------------------------------------------------- /Classes/SerialCommunication.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SerialCommunication.framework for iOS 3 | * SerialCommunication.h 4 | * 5 | * Copyright (c) Yusuke Sekikawa, 11/06/02 6 | * All rights reserved. 7 | * 8 | * BSD License 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, are 11 | * permitted provided that the following conditions are met: 12 | * - Redistributions of source code must retain the above copyright notice, this list of 13 | * conditions and the following disclaimer. 14 | * - Redistributions in binary form must reproduce the above copyright notice, this list 15 | * of conditions and the following disclaimer in the documentation and/or other materia 16 | * ls provided with the distribution. 17 | * - Neither the name of the "Yusuke Sekikawa" nor the names of its contributors may be u 18 | * sed to endorse or promote products derived from this software without specific prior 19 | * written permission. 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY E 21 | * XPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES O 22 | * F MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SH 23 | * ALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENT 24 | * AL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROC 25 | * UREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS I 26 | * NTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI 27 | * CT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF T 28 | * HE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | // For more info 32 | // GitHub 33 | // http://devdot.wikispaces.com/Iphone+Serial+Port+Tutorial 34 | 35 | 36 | #import 37 | 38 | #define TYPE_SERVER 0x01 39 | #define TYPE_CLIENT 0x02 40 | #define TYPE_LOCAL 0x03 41 | 42 | 43 | 44 | @class AsyncSocket; 45 | 46 | @protocol SerialCommunicationDelegate; 47 | 48 | @interface SerialCommunication : NSObject { 49 | id delegate; 50 | int serialFD; 51 | int socketType; 52 | BOOL isServing; 53 | 54 | AsyncSocket *serialSocket; 55 | NSMutableArray *connectedClients; 56 | bool running; 57 | } 58 | @property (nonatomic, assign) id delegate; 59 | @property (readonly,getter=isRunning) bool running; 60 | - (id)initWithType:(uint8_t)type; 61 | - (void) startOnPort:(int)port; 62 | - (void) stop; 63 | - (BOOL)isDeviceConnected; 64 | - (int)sendSerialData:(uint32_t)data; 65 | - (void)normalConnectTo:(NSString*)host port:(int)port; 66 | - (NSString *) wanAddress; 67 | - (NSString *) wifiAddress; 68 | @end 69 | 70 | @protocol SerialCommunicationDelegate 71 | -(void)serialDataRecieved:(int)data; 72 | -(void)serialAlert:(NSString*)msg; 73 | -(void)disconnectedWithPeer; 74 | -(void)connectedWithPeer:(BOOL)result; 75 | @end 76 | -------------------------------------------------------------------------------- /Classes/SerialCommunication.m: -------------------------------------------------------------------------------- 1 | /* 2 | * SerialCommunication.framework for iOS 3 | * SerialCommunication.h 4 | * 5 | * Copyright (c) Yusuke Sekikawa, 11/06/02 6 | * All rights reserved. 7 | * 8 | * BSD License 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, are 11 | * permitted provided that the following conditions are met: 12 | * - Redistributions of source code must retain the above copyright notice, this list of 13 | * conditions and the following disclaimer. 14 | * - Redistributions in binary form must reproduce the above copyright notice, this list 15 | * of conditions and the following disclaimer in the documentation and/or other materia 16 | * ls provided with the distribution. 17 | * - Neither the name of the "Yusuke Sekikawa" nor the names of its contributors may be u 18 | * sed to endorse or promote products derived from this software without specific prior 19 | * written permission. 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY E 21 | * XPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES O 22 | * F MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SH 23 | * ALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENT 24 | * AL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROC 25 | * UREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS I 26 | * NTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI 27 | * CT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF T 28 | * HE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #import "SerialCommunication.h" 31 | 32 | #import "serial.h" 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #import 49 | #import 50 | #import 51 | #import 52 | #import 53 | #import 54 | 55 | 56 | 57 | #import "AsyncSocket.h" 58 | 59 | int WelcomeMsgTag=0; 60 | int GenericMsgTag=1; 61 | 62 | 63 | @implementation SerialCommunication 64 | @synthesize delegate; 65 | @synthesize running; 66 | 67 | -(BOOL)isDeviceConnected{ 68 | return YES; 69 | } 70 | -(int)openSerialPort{ 71 | 72 | struct termios org_termios_s; 73 | struct termios my_termios_s; 74 | serialFD = -1; 75 | 76 | // Open serial port 77 | if((serialFD = open("/dev/tty.iap", O_RDWR | O_NOCTTY | O_NONBLOCK)) == -1) { 78 | NSLog(@"open failed"); 79 | return serialFD; 80 | } 81 | if(ioctl(serialFD, TIOCEXCL) == -1) { 82 | NSLog(@"TIOCEXCL"); 83 | close(serialFD); 84 | return serialFD; 85 | } 86 | if(fcntl(serialFD, F_SETFL, 0) == -1) { 87 | NSLog(@"clear O_NONBLOCK"); 88 | close(serialFD); 89 | return serialFD; 90 | } 91 | 92 | // Get original termios 93 | if(tcgetattr(serialFD, &org_termios_s) == -1) { 94 | NSLog(@"get serial original termios"); 95 | close(serialFD); 96 | return serialFD; 97 | } 98 | 99 | // Make my termios 100 | my_termios_s = org_termios_s; 101 | cfmakeraw(&my_termios_s); 102 | my_termios_s.c_iflag = 0; 103 | my_termios_s.c_oflag = 0; 104 | my_termios_s.c_cflag |= (CREAD|HUPCL); 105 | my_termios_s.c_cflag &= ~CSTOPB; 106 | my_termios_s.c_cc[VMIN] = 0; //can't detect modem hungups (cf. http://www.sbin.org/doc/unix-faq/programmer/faq_4.html#SEC60) 107 | my_termios_s.c_cc[VTIME] = 0; 108 | cfsetspeed(&my_termios_s, B9600); 109 | 110 | // Change terminal settings 111 | if(tcsetattr(serialFD, TCSANOW, &my_termios_s) == -1) { 112 | NSLog(@"set my serial termios"); 113 | close(serialFD); 114 | return false; 115 | } 116 | 117 | // Success 118 | return serialFD; 119 | } 120 | 121 | 122 | -(void)serialDataRecieved:(NSNumber*)uint32_tNum{ 123 | [self.delegate serialDataRecieved:[uint32_tNum intValue]]; 124 | 125 | int serialData=[uint32_tNum unsignedIntValue]; 126 | 127 | if(self.running){ 128 | if(socketType==TYPE_SERVER){ 129 | for (AsyncSocket* socket in connectedClients){ 130 | //[socket disconnect]; 131 | [socket writeData:[NSData dataWithBytes:&serialData length:sizeof(uint32_t)] withTimeout:-1 tag:WelcomeMsgTag]; 132 | } 133 | }else{ 134 | ; 135 | } 136 | } 137 | 138 | 139 | } 140 | -(void)serialAlert:(NSString*)msg{ 141 | [self.delegate serialAlert:msg]; 142 | } 143 | 144 | -(int)sendSerialData:(uint32_t)data{ 145 | //NSLog(@"Sent %x",data); 146 | //return write(serialFD,&data,sizeof(uint32_t)); // Write 32bit 147 | if(socketType==TYPE_SERVER){ 148 | 149 | #if 0 150 | //[sock writeData:welcomeData withTimeout:-1 tag:WelcomeMsgTag]; 151 | 152 | NSLog(@"sendSerialData TEST %X",data); 153 | 154 | for (AsyncSocket* socket in connectedClients){ 155 | //[socket disconnect]; 156 | [socket writeData:[NSData dataWithBytes:&data length:sizeof(uint32_t)] withTimeout:-1 tag:WelcomeMsgTag]; 157 | } 158 | 159 | #endif 160 | return write(serialFD,&data,sizeof(uint32_t)); // Write 32bit 161 | 162 | 163 | }else{ 164 | [serialSocket writeData:[NSData dataWithBytes:&data length:sizeof(uint32_t)] withTimeout:-1 tag:GenericMsgTag]; 165 | return 0; 166 | } 167 | } 168 | -(void)readSerialData{ 169 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 170 | uint32_t data=0x00000000; 171 | 172 | while (1) { 173 | data=0x00; 174 | if(serialFD<0){ 175 | break; 176 | } 177 | int len=read(serialFD,&data,sizeof(uint32_t)); // Read 32bit 178 | if (len>0) { 179 | /* read some charactor over serial */ 180 | [self performSelectorOnMainThread:@selector(serialDataRecieved:) withObject:[NSNumber numberWithInt:data] waitUntilDone:NO]; 181 | } 182 | } 183 | [pool release]; 184 | } 185 | 186 | 187 | // Return the iPhone's IP address 188 | - (NSString *) wifiAddress 189 | { 190 | char baseHostName[255]; 191 | gethostname(baseHostName, 255); 192 | 193 | char hn[255]; 194 | sprintf(hn, "%s.local", baseHostName); 195 | struct hostent *host = gethostbyname(hn); 196 | if (host == NULL) 197 | { 198 | herror("resolv"); 199 | return NULL; 200 | } 201 | else { 202 | struct in_addr **list = (struct in_addr **)host->h_addr_list; 203 | NSString *wifiAddress=[NSString stringWithCString:inet_ntoa(*list[0]) encoding:NSASCIIStringEncoding]; 204 | if([wifiAddress isEqualToString:@"127.0.0.1"]){ 205 | return @"N/A"; 206 | }else{ 207 | return wifiAddress; 208 | } 209 | 210 | //return [NSString stringWithFormat:@"
or
http://%@:%d
http://%@:%d", [NSString stringWithCString:inet_ntoa(*list[0])], chosenPort,ThreeG_IP,chosenPort]; 211 | } 212 | } 213 | - (NSString *) wanAddress 214 | { 215 | struct ifaddrs * addrs, * ifloop; 216 | char buf[64]; 217 | struct sockaddr_in *s4; 218 | NSString *wanAddress; 219 | getifaddrs(&addrs); 220 | for (ifloop = addrs; ifloop != NULL; ifloop = ifloop->ifa_next) 221 | { 222 | s4 = (struct sockaddr_in *)(ifloop->ifa_addr); 223 | inet_ntop(ifloop->ifa_addr->sa_family, (void *)&(s4->sin_addr), buf, sizeof(buf)) == NULL; 224 | const char * ifname = ifloop->ifa_name; 225 | if (memcmp(ifname, "pdp_ip1", 7) == 1) 226 | { 227 | printf("******%s: %s*******\n", ifloop->ifa_name, buf); 228 | wanAddress=[[NSString alloc] initWithUTF8String:buf]; 229 | } 230 | printf("----%s: %s----\n", ifloop->ifa_name, buf); 231 | //printf("%s: %s----\n", ifloop->ifa_addr, buf); 232 | } 233 | if([wanAddress isEqualToString:@"127.0.0.1"]){ 234 | return @"N/A"; 235 | }else{ 236 | return wanAddress; 237 | } 238 | } 239 | //TODO. 240 | //In future update,this framework provide socket access from remote devece. 241 | 242 | -(void)addLog:(NSString*)str{ 243 | ; 244 | } 245 | 246 | - (id)initWithType:(uint8_t)type{ 247 | socketType=type; 248 | if((self=[super init])){ 249 | if(type==TYPE_LOCAL || type==TYPE_SERVER){ 250 | serialFD=[self openSerialPort]; 251 | if(serialFD>0){ 252 | [NSThread detachNewThreadSelector:@selector(readSerialData) toTarget:self withObject:nil]; 253 | [self serialAlert:@"Open Serial Port Success!"]; 254 | running = false; 255 | if(type==TYPE_SERVER){ 256 | NSLog(@"[TYPE_SERVER]Open Serial Port Success! Work As Remote Server"); 257 | serialSocket = [[AsyncSocket alloc] initWithDelegate:self]; 258 | connectedClients = [[NSMutableArray alloc] initWithCapacity:1]; 259 | }else{ 260 | NSLog(@"[TYPE_LOCAL]Open Serial Port Success!"); 261 | } 262 | }else{ 263 | [self serialAlert:@"Open Serial Port Failed!"]; 264 | NSLog(@"Open Serial Port Failed!"); 265 | [self release]; 266 | self = nil; 267 | } 268 | }else if(type==TYPE_CLIENT){ 269 | NSLog(@"Work As Remote Client"); 270 | serialSocket = [[AsyncSocket alloc] initWithDelegate:self]; 271 | connectedClients = [[NSMutableArray alloc] initWithCapacity:1]; 272 | running = false; 273 | }else{ 274 | NSLog(@"Invalid Mode"); 275 | [self release]; 276 | self = nil; 277 | } 278 | } 279 | return self; 280 | } 281 | 282 | - (void)dealloc { 283 | close(serialFD); 284 | serialFD=-1; 285 | 286 | [self stop]; 287 | [connectedClients release]; 288 | [serialSocket release]; 289 | [super dealloc]; 290 | } 291 | 292 | 293 | #pragma Async Socket Delegate 294 | 295 | - (void) startOnPort:(int)port; 296 | { 297 | if (running) return; 298 | 299 | if (port < 0 || port > 65535) 300 | port = 0; 301 | 302 | NSError *error = nil; 303 | if (![serialSocket acceptOnPort:port error:&error]) 304 | return; 305 | 306 | NSLog(@"My Awesome Serial Server has started on port %hu", [serialSocket localPort]); 307 | 308 | running = true; 309 | } 310 | 311 | 312 | - (void) stop; 313 | { 314 | if (!running) return; 315 | 316 | [serialSocket disconnect]; 317 | for (AsyncSocket* socket in connectedClients) 318 | [socket disconnect]; 319 | 320 | running = false; 321 | } 322 | 323 | - (void)onSocket:(AsyncSocket *)socket didAcceptNewSocket:(AsyncSocket *)newSocket; 324 | { 325 | [connectedClients addObject:newSocket]; 326 | } 327 | 328 | 329 | - (void)onSocketDidDisconnect:(AsyncSocket *)socket; 330 | { 331 | [connectedClients removeObject:socket]; 332 | [self.delegate disconnectedWithPeer]; 333 | //NSLog(@"socketDidDisconnect:%p withError: %@", sock, err); 334 | 335 | } 336 | 337 | 338 | - (void)normalConnectTo:(NSString*)host port:(int)port 339 | { 340 | NSError *error = nil; 341 | running = true; 342 | 343 | //NSString *host = @"google.com"; 344 | // NSString *host = @"deusty.com"; 345 | NSLog(@"normalConnectTo %@:%d",host,port); 346 | if (![serialSocket connectToHost:host onPort:port error:&error]) 347 | { 348 | NSLog(@"Error connecting: %@", error); 349 | } 350 | 351 | // You can also specify an optional connect timeout. 352 | 353 | //if (![serialSocket connectToHost:host onPort:9999 withTimeout:5.0 error:&error]) 354 | //{ 355 | // NSLog(@"Error connecting: %@", error); 356 | //} 357 | } 358 | - (void)onSocket:(AsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port 359 | { 360 | if(socketType==TYPE_SERVER){ 361 | [self.delegate connectedWithPeer:true]; 362 | NSLog(@"Accepted client %@:%hu", host, port); 363 | 364 | NSData *welcomeData = [@"Welcome to my Awesome Debug Server\r\n" 365 | dataUsingEncoding:NSUTF8StringEncoding]; 366 | [sock writeData:welcomeData withTimeout:-1 tag:WelcomeMsgTag]; 367 | 368 | [sock readDataWithTimeout:-1 tag:GenericMsgTag]; 369 | }else{ 370 | [self.delegate connectedWithPeer:true]; 371 | //[sock readDataWithTimeout:-1 tag:GenericMsgTag]; 372 | 373 | 374 | NSLog(@"socket:%p didConnectToHost():%@ port:%hu", sock, host, port); 375 | [serialSocket readDataWithTimeout:-1 tag:GenericMsgTag]; 376 | 377 | // DDLogInfo(@"localHost :%@ port:%hu", [sock localHost], [sock localPort]); 378 | 379 | 380 | //if (port == 443)//Secure Conneections 381 | if (0)//Secure Conneections 382 | { 383 | 384 | #if 0 385 | // Backgrounding doesn't seem to be supported on the simulator yet 386 | [sock performBlock:^{ 387 | if ([sock enableBackgroundingOnSocketWithCaveat]) 388 | NSLog(@"Enabled backgrounding on socket"); 389 | else 390 | NSLog(@"Enabling backgrounding failed!"); 391 | }]; 392 | 393 | #endif 394 | 395 | // Configure SSL/TLS settings 396 | NSMutableDictionary *settings = [NSMutableDictionary dictionaryWithCapacity:3]; 397 | 398 | // If you simply want to ensure that the remote host's certificate is valid, 399 | // then you can use an empty dictionary. 400 | 401 | // If you know the name of the remote host, then you should specify the name here. 402 | // 403 | // NOTE: 404 | // You should understand the security implications if you do not specify the peer name. 405 | // Please see the documentation for the startTLS method in GCDAsyncSocket.h for a full discussion. 406 | 407 | [settings setObject:@"www.paypal.com" 408 | forKey:(NSString *)kCFStreamSSLPeerName]; 409 | 410 | // To connect to a test server, with a self-signed certificate, use settings similar to this: 411 | 412 | // // Allow expired certificates 413 | // [settings setObject:[NSNumber numberWithBool:YES] 414 | // forKey:(NSString *)kCFStreamSSLAllowsExpiredCertificates]; 415 | // 416 | // // Allow self-signed certificates 417 | // [settings setObject:[NSNumber numberWithBool:YES] 418 | // forKey:(NSString *)kCFStreamSSLAllowsAnyRoot]; 419 | // 420 | // // In fact, don't even validate the certificate chain 421 | // [settings setObject:[NSNumber numberWithBool:NO] 422 | // forKey:(NSString *)kCFStreamSSLValidatesCertificateChain]; 423 | 424 | NSLog(@"Starting TLS with settings:\n%@", settings); 425 | 426 | [sock startTLS:settings]; 427 | 428 | // You can also pass nil to the startTLS method, which is the same as passing an empty dictionary. 429 | // Again, you should understand the security implications of doing so. 430 | // Please see the documentation for the startTLS method in GCDAsyncSocket.h for a full discussion. 431 | } 432 | } 433 | } 434 | 435 | - (void)onSocket:(AsyncSocket *)socket didReadData:(NSData *)data withTag:(long)tag; 436 | { 437 | int *serialData; 438 | serialData=(int*)[data bytes]; 439 | 440 | if(socketType==TYPE_SERVER){ 441 | NSLog(@"[TYPE_SERVER] Send Data over serial %x,%d",*serialData,[data length]); 442 | write(serialFD,serialData,sizeof(uint32_t)); // Write 32bit 443 | }else{ 444 | NSLog(@"[TYPE_CLIENT] Send Data APP %x,%d",*serialData,[data length]); 445 | [self serialDataRecieved:[NSNumber numberWithUnsignedInt:*serialData]]; 446 | } 447 | 448 | NSString *tmp = [NSString stringWithUTF8String:[data bytes]]; 449 | NSString *input = [tmp stringByTrimmingCharactersInSet: 450 | [NSCharacterSet whitespaceAndNewlineCharacterSet]]; 451 | 452 | if ([input isEqualToString:@"exit"]) 453 | { 454 | NSData *byeData = [@"Bye!\r\n" dataUsingEncoding:NSUTF8StringEncoding]; 455 | [socket writeData:byeData withTimeout:-1 tag:GenericMsgTag]; 456 | [socket disconnectAfterWriting]; 457 | return; 458 | } 459 | 460 | [socket readDataWithTimeout:-1 tag:GenericMsgTag]; 461 | } 462 | - (void)socketDidDisconnect:(AsyncSocket *)sock withError:(NSError *)err 463 | { 464 | [self.delegate disconnectedWithPeer]; 465 | NSLog(@"socketDidDisconnect:%p withError: %@", sock, err); 466 | } 467 | 468 | @end 469 | -------------------------------------------------------------------------------- /Classes/cocoaasyncsocket/AsyncSocket.h: -------------------------------------------------------------------------------- 1 | // 2 | // AsyncSocket.h 3 | // 4 | // This class is in the public domain. 5 | // Originally created by Dustin Voss on Wed Jan 29 2003. 6 | // Updated and maintained by Deusty Designs and the Mac development community. 7 | // 8 | // http://code.google.com/p/cocoaasyncsocket/ 9 | // 10 | 11 | #import 12 | 13 | @class AsyncSocket; 14 | @class AsyncReadPacket; 15 | @class AsyncWritePacket; 16 | 17 | extern NSString *const AsyncSocketException; 18 | extern NSString *const AsyncSocketErrorDomain; 19 | 20 | enum AsyncSocketError 21 | { 22 | AsyncSocketCFSocketError = kCFSocketError, // From CFSocketError enum. 23 | AsyncSocketNoError = 0, // Never used. 24 | AsyncSocketCanceledError, // onSocketWillConnect: returned NO. 25 | AsyncSocketConnectTimeoutError, 26 | AsyncSocketReadMaxedOutError, // Reached set maxLength without completing 27 | AsyncSocketReadTimeoutError, 28 | AsyncSocketWriteTimeoutError 29 | }; 30 | typedef enum AsyncSocketError AsyncSocketError; 31 | 32 | @protocol AsyncSocketDelegate 33 | @optional 34 | 35 | /** 36 | * In the event of an error, the socket is closed. 37 | * You may call "unreadData" during this call-back to get the last bit of data off the socket. 38 | * When connecting, this delegate method may be called 39 | * before"onSocket:didAcceptNewSocket:" or "onSocket:didConnectToHost:". 40 | **/ 41 | - (void)onSocket:(AsyncSocket *)sock willDisconnectWithError:(NSError *)err; 42 | 43 | /** 44 | * Called when a socket disconnects with or without error. If you want to release a socket after it disconnects, 45 | * do so here. It is not safe to do that during "onSocket:willDisconnectWithError:". 46 | * 47 | * If you call the disconnect method, and the socket wasn't already disconnected, 48 | * this delegate method will be called before the disconnect method returns. 49 | **/ 50 | - (void)onSocketDidDisconnect:(AsyncSocket *)sock; 51 | 52 | /** 53 | * Called when a socket accepts a connection. Another socket is spawned to handle it. The new socket will have 54 | * the same delegate and will call "onSocket:didConnectToHost:port:". 55 | **/ 56 | - (void)onSocket:(AsyncSocket *)sock didAcceptNewSocket:(AsyncSocket *)newSocket; 57 | 58 | /** 59 | * Called when a new socket is spawned to handle a connection. This method should return the run-loop of the 60 | * thread on which the new socket and its delegate should operate. If omitted, [NSRunLoop currentRunLoop] is used. 61 | **/ 62 | - (NSRunLoop *)onSocket:(AsyncSocket *)sock wantsRunLoopForNewSocket:(AsyncSocket *)newSocket; 63 | 64 | /** 65 | * Called when a socket is about to connect. This method should return YES to continue, or NO to abort. 66 | * If aborted, will result in AsyncSocketCanceledError. 67 | * 68 | * If the connectToHost:onPort:error: method was called, the delegate will be able to access and configure the 69 | * CFReadStream and CFWriteStream as desired prior to connection. 70 | * 71 | * If the connectToAddress:error: method was called, the delegate will be able to access and configure the 72 | * CFSocket and CFSocketNativeHandle (BSD socket) as desired prior to connection. You will be able to access and 73 | * configure the CFReadStream and CFWriteStream in the onSocket:didConnectToHost:port: method. 74 | **/ 75 | - (BOOL)onSocketWillConnect:(AsyncSocket *)sock; 76 | 77 | /** 78 | * Called when a socket connects and is ready for reading and writing. 79 | * The host parameter will be an IP address, not a DNS name. 80 | **/ 81 | - (void)onSocket:(AsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port; 82 | 83 | /** 84 | * Called when a socket has completed reading the requested data into memory. 85 | * Not called if there is an error. 86 | **/ 87 | - (void)onSocket:(AsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag; 88 | 89 | /** 90 | * Called when a socket has read in data, but has not yet completed the read. 91 | * This would occur if using readToData: or readToLength: methods. 92 | * It may be used to for things such as updating progress bars. 93 | **/ 94 | - (void)onSocket:(AsyncSocket *)sock didReadPartialDataOfLength:(NSUInteger)partialLength tag:(long)tag; 95 | 96 | /** 97 | * Called when a socket has completed writing the requested data. Not called if there is an error. 98 | **/ 99 | - (void)onSocket:(AsyncSocket *)sock didWriteDataWithTag:(long)tag; 100 | 101 | /** 102 | * Called when a socket has written some data, but has not yet completed the entire write. 103 | * It may be used to for things such as updating progress bars. 104 | **/ 105 | - (void)onSocket:(AsyncSocket *)sock didWritePartialDataOfLength:(NSUInteger)partialLength tag:(long)tag; 106 | 107 | /** 108 | * Called if a read operation has reached its timeout without completing. 109 | * This method allows you to optionally extend the timeout. 110 | * If you return a positive time interval (> 0) the read's timeout will be extended by the given amount. 111 | * If you don't implement this method, or return a non-positive time interval (<= 0) the read will timeout as usual. 112 | * 113 | * The elapsed parameter is the sum of the original timeout, plus any additions previously added via this method. 114 | * The length parameter is the number of bytes that have been read so far for the read operation. 115 | * 116 | * Note that this method may be called multiple times for a single read if you return positive numbers. 117 | **/ 118 | - (NSTimeInterval)onSocket:(AsyncSocket *)sock 119 | shouldTimeoutReadWithTag:(long)tag 120 | elapsed:(NSTimeInterval)elapsed 121 | bytesDone:(NSUInteger)length; 122 | 123 | /** 124 | * Called if a write operation has reached its timeout without completing. 125 | * This method allows you to optionally extend the timeout. 126 | * If you return a positive time interval (> 0) the write's timeout will be extended by the given amount. 127 | * If you don't implement this method, or return a non-positive time interval (<= 0) the write will timeout as usual. 128 | * 129 | * The elapsed parameter is the sum of the original timeout, plus any additions previously added via this method. 130 | * The length parameter is the number of bytes that have been written so far for the write operation. 131 | * 132 | * Note that this method may be called multiple times for a single write if you return positive numbers. 133 | **/ 134 | - (NSTimeInterval)onSocket:(AsyncSocket *)sock 135 | shouldTimeoutWriteWithTag:(long)tag 136 | elapsed:(NSTimeInterval)elapsed 137 | bytesDone:(NSUInteger)length; 138 | 139 | /** 140 | * Called after the socket has successfully completed SSL/TLS negotiation. 141 | * This method is not called unless you use the provided startTLS method. 142 | * 143 | * If a SSL/TLS negotiation fails (invalid certificate, etc) then the socket will immediately close, 144 | * and the onSocket:willDisconnectWithError: delegate method will be called with the specific SSL error code. 145 | **/ 146 | - (void)onSocketDidSecure:(AsyncSocket *)sock; 147 | 148 | @end 149 | 150 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 151 | #pragma mark - 152 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 153 | 154 | @interface AsyncSocket : NSObject 155 | { 156 | CFSocketNativeHandle theNativeSocket4; 157 | CFSocketNativeHandle theNativeSocket6; 158 | 159 | CFSocketRef theSocket4; // IPv4 accept or connect socket 160 | CFSocketRef theSocket6; // IPv6 accept or connect socket 161 | 162 | CFReadStreamRef theReadStream; 163 | CFWriteStreamRef theWriteStream; 164 | 165 | CFRunLoopSourceRef theSource4; // For theSocket4 166 | CFRunLoopSourceRef theSource6; // For theSocket6 167 | CFRunLoopRef theRunLoop; 168 | CFSocketContext theContext; 169 | NSArray *theRunLoopModes; 170 | 171 | NSTimer *theConnectTimer; 172 | 173 | NSMutableArray *theReadQueue; 174 | AsyncReadPacket *theCurrentRead; 175 | NSTimer *theReadTimer; 176 | NSMutableData *partialReadBuffer; 177 | 178 | NSMutableArray *theWriteQueue; 179 | AsyncWritePacket *theCurrentWrite; 180 | NSTimer *theWriteTimer; 181 | 182 | id theDelegate; 183 | UInt16 theFlags; 184 | 185 | long theUserData; 186 | } 187 | 188 | - (id)init; 189 | - (id)initWithDelegate:(id)delegate; 190 | - (id)initWithDelegate:(id)delegate userData:(long)userData; 191 | 192 | /* String representation is long but has no "\n". */ 193 | - (NSString *)description; 194 | 195 | /** 196 | * Use "canSafelySetDelegate" to see if there is any pending business (reads and writes) with the current delegate 197 | * before changing it. It is, of course, safe to change the delegate before connecting or accepting connections. 198 | **/ 199 | - (id)delegate; 200 | - (BOOL)canSafelySetDelegate; 201 | - (void)setDelegate:(id)delegate; 202 | 203 | /* User data can be a long, or an id or void * cast to a long. */ 204 | - (long)userData; 205 | - (void)setUserData:(long)userData; 206 | 207 | /* Don't use these to read or write. And don't close them either! */ 208 | - (CFSocketRef)getCFSocket; 209 | - (CFReadStreamRef)getCFReadStream; 210 | - (CFWriteStreamRef)getCFWriteStream; 211 | 212 | // Once one of the accept or connect methods are called, the AsyncSocket instance is locked in 213 | // and the other accept/connect methods can't be called without disconnecting the socket first. 214 | // If the attempt fails or times out, these methods either return NO or 215 | // call "onSocket:willDisconnectWithError:" and "onSockedDidDisconnect:". 216 | 217 | // When an incoming connection is accepted, AsyncSocket invokes several delegate methods. 218 | // These methods are (in chronological order): 219 | // 1. onSocket:didAcceptNewSocket: 220 | // 2. onSocket:wantsRunLoopForNewSocket: 221 | // 3. onSocketWillConnect: 222 | // 223 | // Your server code will need to retain the accepted socket (if you want to accept it). 224 | // The best place to do this is probably in the onSocket:didAcceptNewSocket: method. 225 | // 226 | // After the read and write streams have been setup for the newly accepted socket, 227 | // the onSocket:didConnectToHost:port: method will be called on the proper run loop. 228 | // 229 | // Multithreading Note: If you're going to be moving the newly accepted socket to another run 230 | // loop by implementing onSocket:wantsRunLoopForNewSocket:, then you should wait until the 231 | // onSocket:didConnectToHost:port: method before calling read, write, or startTLS methods. 232 | // Otherwise read/write events are scheduled on the incorrect runloop, and chaos may ensue. 233 | 234 | /** 235 | * Tells the socket to begin listening and accepting connections on the given port. 236 | * When a connection comes in, the AsyncSocket instance will call the various delegate methods (see above). 237 | * The socket will listen on all available interfaces (e.g. wifi, ethernet, etc) 238 | **/ 239 | - (BOOL)acceptOnPort:(UInt16)port error:(NSError **)errPtr; 240 | 241 | /** 242 | * This method is the same as acceptOnPort:error: with the additional option 243 | * of specifying which interface to listen on. So, for example, if you were writing code for a server that 244 | * has multiple IP addresses, you could specify which address you wanted to listen on. Or you could use it 245 | * to specify that the socket should only accept connections over ethernet, and not other interfaces such as wifi. 246 | * You may also use the special strings "localhost" or "loopback" to specify that 247 | * the socket only accept connections from the local machine. 248 | * 249 | * To accept connections on any interface pass nil, or simply use the acceptOnPort:error: method. 250 | **/ 251 | - (BOOL)acceptOnInterface:(NSString *)interface port:(UInt16)port error:(NSError **)errPtr; 252 | 253 | /** 254 | * Connects to the given host and port. 255 | * The host may be a domain name (e.g. "deusty.com") or an IP address string (e.g. "192.168.0.2") 256 | **/ 257 | - (BOOL)connectToHost:(NSString *)hostname onPort:(UInt16)port error:(NSError **)errPtr; 258 | 259 | /** 260 | * This method is the same as connectToHost:onPort:error: with an additional timeout option. 261 | * To not time out use a negative time interval, or simply use the connectToHost:onPort:error: method. 262 | **/ 263 | - (BOOL)connectToHost:(NSString *)hostname 264 | onPort:(UInt16)port 265 | withTimeout:(NSTimeInterval)timeout 266 | error:(NSError **)errPtr; 267 | 268 | /** 269 | * Connects to the given address, specified as a sockaddr structure wrapped in a NSData object. 270 | * For example, a NSData object returned from NSNetservice's addresses method. 271 | * 272 | * If you have an existing struct sockaddr you can convert it to a NSData object like so: 273 | * struct sockaddr sa -> NSData *dsa = [NSData dataWithBytes:&remoteAddr length:remoteAddr.sa_len]; 274 | * struct sockaddr *sa -> NSData *dsa = [NSData dataWithBytes:remoteAddr length:remoteAddr->sa_len]; 275 | **/ 276 | - (BOOL)connectToAddress:(NSData *)remoteAddr error:(NSError **)errPtr; 277 | 278 | /** 279 | * This method is the same as connectToAddress:error: with an additional timeout option. 280 | * To not time out use a negative time interval, or simply use the connectToAddress:error: method. 281 | **/ 282 | - (BOOL)connectToAddress:(NSData *)remoteAddr withTimeout:(NSTimeInterval)timeout error:(NSError **)errPtr; 283 | 284 | - (BOOL)connectToAddress:(NSData *)remoteAddr 285 | viaInterfaceAddress:(NSData *)interfaceAddr 286 | withTimeout:(NSTimeInterval)timeout 287 | error:(NSError **)errPtr; 288 | 289 | /** 290 | * Disconnects immediately. Any pending reads or writes are dropped. 291 | * If the socket is not already disconnected, the onSocketDidDisconnect delegate method 292 | * will be called immediately, before this method returns. 293 | * 294 | * Please note the recommended way of releasing an AsyncSocket instance (e.g. in a dealloc method) 295 | * [asyncSocket setDelegate:nil]; 296 | * [asyncSocket disconnect]; 297 | * [asyncSocket release]; 298 | **/ 299 | - (void)disconnect; 300 | 301 | /** 302 | * Disconnects after all pending reads have completed. 303 | * After calling this, the read and write methods will do nothing. 304 | * The socket will disconnect even if there are still pending writes. 305 | **/ 306 | - (void)disconnectAfterReading; 307 | 308 | /** 309 | * Disconnects after all pending writes have completed. 310 | * After calling this, the read and write methods will do nothing. 311 | * The socket will disconnect even if there are still pending reads. 312 | **/ 313 | - (void)disconnectAfterWriting; 314 | 315 | /** 316 | * Disconnects after all pending reads and writes have completed. 317 | * After calling this, the read and write methods will do nothing. 318 | **/ 319 | - (void)disconnectAfterReadingAndWriting; 320 | 321 | /* Returns YES if the socket and streams are open, connected, and ready for reading and writing. */ 322 | - (BOOL)isConnected; 323 | 324 | /** 325 | * Returns the local or remote host and port to which this socket is connected, or nil and 0 if not connected. 326 | * The host will be an IP address. 327 | **/ 328 | - (NSString *)connectedHost; 329 | - (UInt16)connectedPort; 330 | 331 | - (NSString *)localHost; 332 | - (UInt16)localPort; 333 | 334 | /** 335 | * Returns the local or remote address to which this socket is connected, 336 | * specified as a sockaddr structure wrapped in a NSData object. 337 | * 338 | * See also the connectedHost, connectedPort, localHost and localPort methods. 339 | **/ 340 | - (NSData *)connectedAddress; 341 | - (NSData *)localAddress; 342 | 343 | /** 344 | * Returns whether the socket is IPv4 or IPv6. 345 | * An accepting socket may be both. 346 | **/ 347 | - (BOOL)isIPv4; 348 | - (BOOL)isIPv6; 349 | 350 | // The readData and writeData methods won't block (they are asynchronous). 351 | // 352 | // When a read is complete the onSocket:didReadData:withTag: delegate method is called. 353 | // When a write is complete the onSocket:didWriteDataWithTag: delegate method is called. 354 | // 355 | // You may optionally set a timeout for any read/write operation. (To not timeout, use a negative time interval.) 356 | // If a read/write opertion times out, the corresponding "onSocket:shouldTimeout..." delegate method 357 | // is called to optionally allow you to extend the timeout. 358 | // Upon a timeout, the "onSocket:willDisconnectWithError:" method is called, followed by "onSocketDidDisconnect". 359 | // 360 | // The tag is for your convenience. 361 | // You can use it as an array index, step number, state id, pointer, etc. 362 | 363 | /** 364 | * Reads the first available bytes that become available on the socket. 365 | * 366 | * If the timeout value is negative, the read operation will not use a timeout. 367 | **/ 368 | - (void)readDataWithTimeout:(NSTimeInterval)timeout tag:(long)tag; 369 | 370 | /** 371 | * Reads the first available bytes that become available on the socket. 372 | * The bytes will be appended to the given byte buffer starting at the given offset. 373 | * The given buffer will automatically be increased in size if needed. 374 | * 375 | * If the timeout value is negative, the read operation will not use a timeout. 376 | * If the buffer if nil, the socket will create a buffer for you. 377 | * 378 | * If the bufferOffset is greater than the length of the given buffer, 379 | * the method will do nothing, and the delegate will not be called. 380 | * 381 | * If you pass a buffer, you must not alter it in any way while AsyncSocket is using it. 382 | * After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer. 383 | * That is, it will reference the bytes that were appended to the given buffer. 384 | **/ 385 | - (void)readDataWithTimeout:(NSTimeInterval)timeout 386 | buffer:(NSMutableData *)buffer 387 | bufferOffset:(NSUInteger)offset 388 | tag:(long)tag; 389 | 390 | /** 391 | * Reads the first available bytes that become available on the socket. 392 | * The bytes will be appended to the given byte buffer starting at the given offset. 393 | * The given buffer will automatically be increased in size if needed. 394 | * A maximum of length bytes will be read. 395 | * 396 | * If the timeout value is negative, the read operation will not use a timeout. 397 | * If the buffer if nil, a buffer will automatically be created for you. 398 | * If maxLength is zero, no length restriction is enforced. 399 | * 400 | * If the bufferOffset is greater than the length of the given buffer, 401 | * the method will do nothing, and the delegate will not be called. 402 | * 403 | * If you pass a buffer, you must not alter it in any way while AsyncSocket is using it. 404 | * After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer. 405 | * That is, it will reference the bytes that were appended to the given buffer. 406 | **/ 407 | - (void)readDataWithTimeout:(NSTimeInterval)timeout 408 | buffer:(NSMutableData *)buffer 409 | bufferOffset:(NSUInteger)offset 410 | maxLength:(NSUInteger)length 411 | tag:(long)tag; 412 | 413 | /** 414 | * Reads the given number of bytes. 415 | * 416 | * If the timeout value is negative, the read operation will not use a timeout. 417 | * 418 | * If the length is 0, this method does nothing and the delegate is not called. 419 | **/ 420 | - (void)readDataToLength:(NSUInteger)length withTimeout:(NSTimeInterval)timeout tag:(long)tag; 421 | 422 | /** 423 | * Reads the given number of bytes. 424 | * The bytes will be appended to the given byte buffer starting at the given offset. 425 | * The given buffer will automatically be increased in size if needed. 426 | * 427 | * If the timeout value is negative, the read operation will not use a timeout. 428 | * If the buffer if nil, a buffer will automatically be created for you. 429 | * 430 | * If the length is 0, this method does nothing and the delegate is not called. 431 | * If the bufferOffset is greater than the length of the given buffer, 432 | * the method will do nothing, and the delegate will not be called. 433 | * 434 | * If you pass a buffer, you must not alter it in any way while AsyncSocket is using it. 435 | * After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer. 436 | * That is, it will reference the bytes that were appended to the given buffer. 437 | **/ 438 | - (void)readDataToLength:(NSUInteger)length 439 | withTimeout:(NSTimeInterval)timeout 440 | buffer:(NSMutableData *)buffer 441 | bufferOffset:(NSUInteger)offset 442 | tag:(long)tag; 443 | 444 | /** 445 | * Reads bytes until (and including) the passed "data" parameter, which acts as a separator. 446 | * 447 | * If the timeout value is negative, the read operation will not use a timeout. 448 | * 449 | * If you pass nil or zero-length data as the "data" parameter, 450 | * the method will do nothing, and the delegate will not be called. 451 | * 452 | * To read a line from the socket, use the line separator (e.g. CRLF for HTTP, see below) as the "data" parameter. 453 | * Note that this method is not character-set aware, so if a separator can occur naturally as part of the encoding for 454 | * a character, the read will prematurely end. 455 | **/ 456 | - (void)readDataToData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag; 457 | 458 | /** 459 | * Reads bytes until (and including) the passed "data" parameter, which acts as a separator. 460 | * The bytes will be appended to the given byte buffer starting at the given offset. 461 | * The given buffer will automatically be increased in size if needed. 462 | * 463 | * If the timeout value is negative, the read operation will not use a timeout. 464 | * If the buffer if nil, a buffer will automatically be created for you. 465 | * 466 | * If the bufferOffset is greater than the length of the given buffer, 467 | * the method will do nothing, and the delegate will not be called. 468 | * 469 | * If you pass a buffer, you must not alter it in any way while AsyncSocket is using it. 470 | * After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer. 471 | * That is, it will reference the bytes that were appended to the given buffer. 472 | * 473 | * To read a line from the socket, use the line separator (e.g. CRLF for HTTP, see below) as the "data" parameter. 474 | * Note that this method is not character-set aware, so if a separator can occur naturally as part of the encoding for 475 | * a character, the read will prematurely end. 476 | **/ 477 | - (void)readDataToData:(NSData *)data 478 | withTimeout:(NSTimeInterval)timeout 479 | buffer:(NSMutableData *)buffer 480 | bufferOffset:(NSUInteger)offset 481 | tag:(long)tag; 482 | 483 | /** 484 | * Reads bytes until (and including) the passed "data" parameter, which acts as a separator. 485 | * 486 | * If the timeout value is negative, the read operation will not use a timeout. 487 | * 488 | * If maxLength is zero, no length restriction is enforced. 489 | * Otherwise if maxLength bytes are read without completing the read, 490 | * it is treated similarly to a timeout - the socket is closed with a AsyncSocketReadMaxedOutError. 491 | * The read will complete successfully if exactly maxLength bytes are read and the given data is found at the end. 492 | * 493 | * If you pass nil or zero-length data as the "data" parameter, 494 | * the method will do nothing, and the delegate will not be called. 495 | * If you pass a maxLength parameter that is less than the length of the data parameter, 496 | * the method will do nothing, and the delegate will not be called. 497 | * 498 | * To read a line from the socket, use the line separator (e.g. CRLF for HTTP, see below) as the "data" parameter. 499 | * Note that this method is not character-set aware, so if a separator can occur naturally as part of the encoding for 500 | * a character, the read will prematurely end. 501 | **/ 502 | - (void)readDataToData:(NSData *)data withTimeout:(NSTimeInterval)timeout maxLength:(NSUInteger)length tag:(long)tag; 503 | 504 | /** 505 | * Reads bytes until (and including) the passed "data" parameter, which acts as a separator. 506 | * The bytes will be appended to the given byte buffer starting at the given offset. 507 | * The given buffer will automatically be increased in size if needed. 508 | * A maximum of length bytes will be read. 509 | * 510 | * If the timeout value is negative, the read operation will not use a timeout. 511 | * If the buffer if nil, a buffer will automatically be created for you. 512 | * 513 | * If maxLength is zero, no length restriction is enforced. 514 | * Otherwise if maxLength bytes are read without completing the read, 515 | * it is treated similarly to a timeout - the socket is closed with a AsyncSocketReadMaxedOutError. 516 | * The read will complete successfully if exactly maxLength bytes are read and the given data is found at the end. 517 | * 518 | * If you pass a maxLength parameter that is less than the length of the data parameter, 519 | * the method will do nothing, and the delegate will not be called. 520 | * If the bufferOffset is greater than the length of the given buffer, 521 | * the method will do nothing, and the delegate will not be called. 522 | * 523 | * If you pass a buffer, you must not alter it in any way while AsyncSocket is using it. 524 | * After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer. 525 | * That is, it will reference the bytes that were appended to the given buffer. 526 | * 527 | * To read a line from the socket, use the line separator (e.g. CRLF for HTTP, see below) as the "data" parameter. 528 | * Note that this method is not character-set aware, so if a separator can occur naturally as part of the encoding for 529 | * a character, the read will prematurely end. 530 | **/ 531 | - (void)readDataToData:(NSData *)data 532 | withTimeout:(NSTimeInterval)timeout 533 | buffer:(NSMutableData *)buffer 534 | bufferOffset:(NSUInteger)offset 535 | maxLength:(NSUInteger)length 536 | tag:(long)tag; 537 | 538 | /** 539 | * Writes data to the socket, and calls the delegate when finished. 540 | * 541 | * If you pass in nil or zero-length data, this method does nothing and the delegate will not be called. 542 | * If the timeout value is negative, the write operation will not use a timeout. 543 | **/ 544 | - (void)writeData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag; 545 | 546 | /** 547 | * Returns progress of current read or write, from 0.0 to 1.0, or NaN if no read/write (use isnan() to check). 548 | * "tag", "done" and "total" will be filled in if they aren't NULL. 549 | **/ 550 | - (float)progressOfReadReturningTag:(long *)tag bytesDone:(NSUInteger *)done total:(NSUInteger *)total; 551 | - (float)progressOfWriteReturningTag:(long *)tag bytesDone:(NSUInteger *)done total:(NSUInteger *)total; 552 | 553 | /** 554 | * Secures the connection using SSL/TLS. 555 | * 556 | * This method may be called at any time, and the TLS handshake will occur after all pending reads and writes 557 | * are finished. This allows one the option of sending a protocol dependent StartTLS message, and queuing 558 | * the upgrade to TLS at the same time, without having to wait for the write to finish. 559 | * Any reads or writes scheduled after this method is called will occur over the secured connection. 560 | * 561 | * The possible keys and values for the TLS settings are well documented. 562 | * Some possible keys are: 563 | * - kCFStreamSSLLevel 564 | * - kCFStreamSSLAllowsExpiredCertificates 565 | * - kCFStreamSSLAllowsExpiredRoots 566 | * - kCFStreamSSLAllowsAnyRoot 567 | * - kCFStreamSSLValidatesCertificateChain 568 | * - kCFStreamSSLPeerName 569 | * - kCFStreamSSLCertificates 570 | * - kCFStreamSSLIsServer 571 | * 572 | * Please refer to Apple's documentation for associated values, as well as other possible keys. 573 | * 574 | * If you pass in nil or an empty dictionary, the default settings will be used. 575 | * 576 | * The default settings will check to make sure the remote party's certificate is signed by a 577 | * trusted 3rd party certificate agency (e.g. verisign) and that the certificate is not expired. 578 | * However it will not verify the name on the certificate unless you 579 | * give it a name to verify against via the kCFStreamSSLPeerName key. 580 | * The security implications of this are important to understand. 581 | * Imagine you are attempting to create a secure connection to MySecureServer.com, 582 | * but your socket gets directed to MaliciousServer.com because of a hacked DNS server. 583 | * If you simply use the default settings, and MaliciousServer.com has a valid certificate, 584 | * the default settings will not detect any problems since the certificate is valid. 585 | * To properly secure your connection in this particular scenario you 586 | * should set the kCFStreamSSLPeerName property to "MySecureServer.com". 587 | * If you do not know the peer name of the remote host in advance (for example, you're not sure 588 | * if it will be "domain.com" or "www.domain.com"), then you can use the default settings to validate the 589 | * certificate, and then use the X509Certificate class to verify the issuer after the socket has been secured. 590 | * The X509Certificate class is part of the CocoaAsyncSocket open source project. 591 | **/ 592 | - (void)startTLS:(NSDictionary *)tlsSettings; 593 | 594 | /** 595 | * For handling readDataToData requests, data is necessarily read from the socket in small increments. 596 | * The performance can be much improved by allowing AsyncSocket to read larger chunks at a time and 597 | * store any overflow in a small internal buffer. 598 | * This is termed pre-buffering, as some data may be read for you before you ask for it. 599 | * If you use readDataToData a lot, enabling pre-buffering will result in better performance, especially on the iPhone. 600 | * 601 | * The default pre-buffering state is controlled by the DEFAULT_PREBUFFERING definition. 602 | * It is highly recommended one leave this set to YES. 603 | * 604 | * This method exists in case pre-buffering needs to be disabled by default for some unforeseen reason. 605 | * In that case, this method exists to allow one to easily enable pre-buffering when ready. 606 | **/ 607 | - (void)enablePreBuffering; 608 | 609 | /** 610 | * When you create an AsyncSocket, it is added to the runloop of the current thread. 611 | * So for manually created sockets, it is easiest to simply create the socket on the thread you intend to use it. 612 | * 613 | * If a new socket is accepted, the delegate method onSocket:wantsRunLoopForNewSocket: is called to 614 | * allow you to place the socket on a separate thread. This works best in conjunction with a thread pool design. 615 | * 616 | * If, however, you need to move the socket to a separate thread at a later time, this 617 | * method may be used to accomplish the task. 618 | * 619 | * This method must be called from the thread/runloop the socket is currently running on. 620 | * 621 | * Note: After calling this method, all further method calls to this object should be done from the given runloop. 622 | * Also, all delegate calls will be sent on the given runloop. 623 | **/ 624 | - (BOOL)moveToRunLoop:(NSRunLoop *)runLoop; 625 | 626 | /** 627 | * Allows you to configure which run loop modes the socket uses. 628 | * The default set of run loop modes is NSDefaultRunLoopMode. 629 | * 630 | * If you'd like your socket to continue operation during other modes, you may want to add modes such as 631 | * NSModalPanelRunLoopMode or NSEventTrackingRunLoopMode. Or you may simply want to use NSRunLoopCommonModes. 632 | * 633 | * Accepted sockets will automatically inherit the same run loop modes as the listening socket. 634 | * 635 | * Note: NSRunLoopCommonModes is defined in 10.5. For previous versions one can use kCFRunLoopCommonModes. 636 | **/ 637 | - (BOOL)setRunLoopModes:(NSArray *)runLoopModes; 638 | - (BOOL)addRunLoopMode:(NSString *)runLoopMode; 639 | - (BOOL)removeRunLoopMode:(NSString *)runLoopMode; 640 | 641 | /** 642 | * Returns the current run loop modes the AsyncSocket instance is operating in. 643 | * The default set of run loop modes is NSDefaultRunLoopMode. 644 | **/ 645 | - (NSArray *)runLoopModes; 646 | 647 | /** 648 | * In the event of an error, this method may be called during onSocket:willDisconnectWithError: to read 649 | * any data that's left on the socket. 650 | **/ 651 | - (NSData *)unreadData; 652 | 653 | /* A few common line separators, for use with the readDataToData:... methods. */ 654 | + (NSData *)CRLFData; // 0x0D0A 655 | + (NSData *)CRData; // 0x0D 656 | + (NSData *)LFData; // 0x0A 657 | + (NSData *)ZeroData; // 0x00 658 | 659 | @end 660 | -------------------------------------------------------------------------------- /Classes/cocoaasyncsocket/AsyncUdpSocket.h: -------------------------------------------------------------------------------- 1 | // 2 | // AsyncUdpSocket.h 3 | // 4 | // This class is in the public domain. 5 | // Originally created by Robbie Hanson on Wed Oct 01 2008. 6 | // Updated and maintained by Deusty Designs and the Mac development community. 7 | // 8 | // http://code.google.com/p/cocoaasyncsocket/ 9 | // 10 | 11 | #import 12 | 13 | @class AsyncSendPacket; 14 | @class AsyncReceivePacket; 15 | 16 | extern NSString *const AsyncUdpSocketException; 17 | extern NSString *const AsyncUdpSocketErrorDomain; 18 | 19 | enum AsyncUdpSocketError 20 | { 21 | AsyncUdpSocketCFSocketError = kCFSocketError, // From CFSocketError enum 22 | AsyncUdpSocketNoError = 0, // Never used 23 | AsyncUdpSocketBadParameter, // Used if given a bad parameter (such as an improper address) 24 | AsyncUdpSocketIPv4Unavailable, // Used if you bind/connect using IPv6 only 25 | AsyncUdpSocketIPv6Unavailable, // Used if you bind/connect using IPv4 only (or iPhone) 26 | AsyncUdpSocketSendTimeoutError, 27 | AsyncUdpSocketReceiveTimeoutError 28 | }; 29 | typedef enum AsyncUdpSocketError AsyncUdpSocketError; 30 | 31 | @interface AsyncUdpSocket : NSObject 32 | { 33 | CFSocketRef theSocket4; // IPv4 socket 34 | CFSocketRef theSocket6; // IPv6 socket 35 | 36 | CFRunLoopSourceRef theSource4; // For theSocket4 37 | CFRunLoopSourceRef theSource6; // For theSocket6 38 | CFRunLoopRef theRunLoop; 39 | CFSocketContext theContext; 40 | NSArray *theRunLoopModes; 41 | 42 | NSMutableArray *theSendQueue; 43 | AsyncSendPacket *theCurrentSend; 44 | NSTimer *theSendTimer; 45 | 46 | NSMutableArray *theReceiveQueue; 47 | AsyncReceivePacket *theCurrentReceive; 48 | NSTimer *theReceiveTimer; 49 | 50 | id theDelegate; 51 | UInt16 theFlags; 52 | 53 | long theUserData; 54 | 55 | NSString *cachedLocalHost; 56 | UInt16 cachedLocalPort; 57 | 58 | NSString *cachedConnectedHost; 59 | UInt16 cachedConnectedPort; 60 | 61 | UInt32 maxReceiveBufferSize; 62 | } 63 | 64 | /** 65 | * Creates new instances of AsyncUdpSocket. 66 | **/ 67 | - (id)init; 68 | - (id)initWithDelegate:(id)delegate; 69 | - (id)initWithDelegate:(id)delegate userData:(long)userData; 70 | 71 | /** 72 | * Creates new instances of AsyncUdpSocket that support only IPv4 or IPv6. 73 | * The other init methods will support both, unless specifically binded or connected to one protocol. 74 | * If you know you'll only be using one protocol, these init methods may be a bit more efficient. 75 | **/ 76 | - (id)initIPv4; 77 | - (id)initIPv6; 78 | 79 | - (id)delegate; 80 | - (void)setDelegate:(id)delegate; 81 | 82 | - (long)userData; 83 | - (void)setUserData:(long)userData; 84 | 85 | /** 86 | * Returns the local address info for the socket. 87 | * 88 | * Note: Address info may not be available until after the socket has been bind'ed, 89 | * or until after data has been sent. 90 | **/ 91 | - (NSString *)localHost; 92 | - (UInt16)localPort; 93 | 94 | /** 95 | * Returns the remote address info for the socket. 96 | * 97 | * Note: Since UDP is connectionless by design, connected address info 98 | * will not be available unless the socket is explicitly connected to a remote host/port 99 | **/ 100 | - (NSString *)connectedHost; 101 | - (UInt16)connectedPort; 102 | 103 | /** 104 | * Returns whether or not this socket has been connected to a single host. 105 | * By design, UDP is a connectionless protocol, and connecting is not needed. 106 | * If connected, the socket will only be able to send/receive data to/from the connected host. 107 | **/ 108 | - (BOOL)isConnected; 109 | 110 | /** 111 | * Returns whether or not this socket has been closed. 112 | * The only way a socket can be closed is if you explicitly call one of the close methods. 113 | **/ 114 | - (BOOL)isClosed; 115 | 116 | /** 117 | * Returns whether or not this socket supports IPv4. 118 | * By default this will be true, unless the socket is specifically initialized as IPv6 only, 119 | * or is binded or connected to an IPv6 address. 120 | **/ 121 | - (BOOL)isIPv4; 122 | 123 | /** 124 | * Returns whether or not this socket supports IPv6. 125 | * By default this will be true, unless the socket is specifically initialized as IPv4 only, 126 | * or is binded or connected to an IPv4 address. 127 | * 128 | * This method will also return false on platforms that do not support IPv6. 129 | * Note: The iPhone does not currently support IPv6. 130 | **/ 131 | - (BOOL)isIPv6; 132 | 133 | /** 134 | * Returns the mtu of the socket. 135 | * If unknown, returns zero. 136 | * 137 | * Sending data larger than this may result in an error. 138 | * This is an advanced topic, and one should understand the wide range of mtu's on networks and the internet. 139 | * Therefore this method is only for reference and may be of little use in many situations. 140 | **/ 141 | - (unsigned int)maximumTransmissionUnit; 142 | 143 | /** 144 | * Binds the UDP socket to the given port and optional address. 145 | * Binding should be done for server sockets that receive data prior to sending it. 146 | * Client sockets can skip binding, 147 | * as the OS will automatically assign the socket an available port when it starts sending data. 148 | * 149 | * You cannot bind a socket after its been connected. 150 | * You can only bind a socket once. 151 | * You can still connect a socket (if desired) after binding. 152 | * 153 | * On success, returns YES. 154 | * Otherwise returns NO, and sets errPtr. If you don't care about the error, you can pass nil for errPtr. 155 | **/ 156 | - (BOOL)bindToPort:(UInt16)port error:(NSError **)errPtr; 157 | - (BOOL)bindToAddress:(NSString *)localAddr port:(UInt16)port error:(NSError **)errPtr; 158 | 159 | /** 160 | * Connects the UDP socket to the given host and port. 161 | * By design, UDP is a connectionless protocol, and connecting is not needed. 162 | * 163 | * Choosing to connect to a specific host/port has the following effect: 164 | * - You will only be able to send data to the connected host/port. 165 | * - You will only be able to receive data from the connected host/port. 166 | * - You will receive ICMP messages that come from the connected host/port, such as "connection refused". 167 | * 168 | * Connecting a UDP socket does not result in any communication on the socket. 169 | * It simply changes the internal state of the socket. 170 | * 171 | * You cannot bind a socket after its been connected. 172 | * You can only connect a socket once. 173 | * 174 | * On success, returns YES. 175 | * Otherwise returns NO, and sets errPtr. If you don't care about the error, you can pass nil for errPtr. 176 | **/ 177 | - (BOOL)connectToHost:(NSString *)host onPort:(UInt16)port error:(NSError **)errPtr; 178 | - (BOOL)connectToAddress:(NSData *)remoteAddr error:(NSError **)errPtr; 179 | 180 | /** 181 | * Join multicast group 182 | * 183 | * Group should be an IP address (eg @"225.228.0.1") 184 | **/ 185 | - (BOOL)joinMulticastGroup:(NSString *)group error:(NSError **)errPtr; 186 | - (BOOL)joinMulticastGroup:(NSString *)group withAddress:(NSString *)interface error:(NSError **)errPtr; 187 | 188 | /** 189 | * By default, the underlying socket in the OS will not allow you to send broadcast messages. 190 | * In order to send broadcast messages, you need to enable this functionality in the socket. 191 | * 192 | * A broadcast is a UDP message to addresses like "192.168.255.255" or "255.255.255.255" that is 193 | * delivered to every host on the network. 194 | * The reason this is generally disabled by default is to prevent 195 | * accidental broadcast messages from flooding the network. 196 | **/ 197 | - (BOOL)enableBroadcast:(BOOL)flag error:(NSError **)errPtr; 198 | 199 | /** 200 | * Asynchronously sends the given data, with the given timeout and tag. 201 | * 202 | * This method may only be used with a connected socket. 203 | * 204 | * If data is nil or zero-length, this method does nothing and immediately returns NO. 205 | * If the socket is not connected, this method does nothing and immediately returns NO. 206 | **/ 207 | - (BOOL)sendData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag; 208 | 209 | /** 210 | * Asynchronously sends the given data, with the given timeout and tag, to the given host and port. 211 | * 212 | * This method cannot be used with a connected socket. 213 | * 214 | * If data is nil or zero-length, this method does nothing and immediately returns NO. 215 | * If the socket is connected, this method does nothing and immediately returns NO. 216 | * If unable to resolve host to a valid IPv4 or IPv6 address, this method returns NO. 217 | **/ 218 | - (BOOL)sendData:(NSData *)data toHost:(NSString *)host port:(UInt16)port withTimeout:(NSTimeInterval)timeout tag:(long)tag; 219 | 220 | /** 221 | * Asynchronously sends the given data, with the given timeout and tag, to the given address. 222 | * 223 | * This method cannot be used with a connected socket. 224 | * 225 | * If data is nil or zero-length, this method does nothing and immediately returns NO. 226 | * If the socket is connected, this method does nothing and immediately returns NO. 227 | **/ 228 | - (BOOL)sendData:(NSData *)data toAddress:(NSData *)remoteAddr withTimeout:(NSTimeInterval)timeout tag:(long)tag; 229 | 230 | /** 231 | * Asynchronously receives a single datagram packet. 232 | * 233 | * If the receive succeeds, the onUdpSocket:didReceiveData:fromHost:port:tag delegate method will be called. 234 | * Otherwise, a timeout will occur, and the onUdpSocket:didNotReceiveDataWithTag: delegate method will be called. 235 | **/ 236 | - (void)receiveWithTimeout:(NSTimeInterval)timeout tag:(long)tag; 237 | 238 | /** 239 | * Closes the socket immediately. Any pending send or receive operations are dropped. 240 | **/ 241 | - (void)close; 242 | 243 | /** 244 | * Closes after all pending send operations have completed. 245 | * After calling this, the sendData: and receive: methods will do nothing. 246 | * In other words, you won't be able to add any more send or receive operations to the queue. 247 | * The socket will close even if there are still pending receive operations. 248 | **/ 249 | - (void)closeAfterSending; 250 | 251 | /** 252 | * Closes after all pending receive operations have completed. 253 | * After calling this, the sendData: and receive: methods will do nothing. 254 | * In other words, you won't be able to add any more send or receive operations to the queue. 255 | * The socket will close even if there are still pending send operations. 256 | **/ 257 | - (void)closeAfterReceiving; 258 | 259 | /** 260 | * Closes after all pending send and receive operations have completed. 261 | * After calling this, the sendData: and receive: methods will do nothing. 262 | * In other words, you won't be able to add any more send or receive operations to the queue. 263 | **/ 264 | - (void)closeAfterSendingAndReceiving; 265 | 266 | /** 267 | * Gets/Sets the maximum size of the buffer that will be allocated for receive operations. 268 | * The default size is 9216 bytes. 269 | * 270 | * The theoretical maximum size of any IPv4 UDP packet is UINT16_MAX = 65535. 271 | * The theoretical maximum size of any IPv6 UDP packet is UINT32_MAX = 4294967295. 272 | * 273 | * In practice, however, the size of UDP packets will be much smaller. 274 | * Indeed most protocols will send and receive packets of only a few bytes, 275 | * or will set a limit on the size of packets to prevent fragmentation in the IP layer. 276 | * 277 | * If you set the buffer size too small, the sockets API in the OS will silently discard 278 | * any extra data, and you will not be notified of the error. 279 | **/ 280 | - (UInt32)maxReceiveBufferSize; 281 | - (void)setMaxReceiveBufferSize:(UInt32)max; 282 | 283 | /** 284 | * When you create an AsyncUdpSocket, it is added to the runloop of the current thread. 285 | * So it is easiest to simply create the socket on the thread you intend to use it. 286 | * 287 | * If, however, you need to move the socket to a separate thread at a later time, this 288 | * method may be used to accomplish the task. 289 | * 290 | * This method must be called from the thread/runloop the socket is currently running on. 291 | * 292 | * Note: After calling this method, all further method calls to this object should be done from the given runloop. 293 | * Also, all delegate calls will be sent on the given runloop. 294 | **/ 295 | - (BOOL)moveToRunLoop:(NSRunLoop *)runLoop; 296 | 297 | /** 298 | * Allows you to configure which run loop modes the socket uses. 299 | * The default set of run loop modes is NSDefaultRunLoopMode. 300 | * 301 | * If you'd like your socket to continue operation during other modes, you may want to add modes such as 302 | * NSModalPanelRunLoopMode or NSEventTrackingRunLoopMode. Or you may simply want to use NSRunLoopCommonModes. 303 | * 304 | * Note: NSRunLoopCommonModes is defined in 10.5. For previous versions one can use kCFRunLoopCommonModes. 305 | **/ 306 | - (BOOL)setRunLoopModes:(NSArray *)runLoopModes; 307 | 308 | /** 309 | * Returns the current run loop modes the AsyncSocket instance is operating in. 310 | * The default set of run loop modes is NSDefaultRunLoopMode. 311 | **/ 312 | - (NSArray *)runLoopModes; 313 | 314 | @end 315 | 316 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 317 | #pragma mark - 318 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 319 | 320 | @protocol AsyncUdpSocketDelegate 321 | @optional 322 | 323 | /** 324 | * Called when the datagram with the given tag has been sent. 325 | **/ 326 | - (void)onUdpSocket:(AsyncUdpSocket *)sock didSendDataWithTag:(long)tag; 327 | 328 | /** 329 | * Called if an error occurs while trying to send a datagram. 330 | * This could be due to a timeout, or something more serious such as the data being too large to fit in a sigle packet. 331 | **/ 332 | - (void)onUdpSocket:(AsyncUdpSocket *)sock didNotSendDataWithTag:(long)tag dueToError:(NSError *)error; 333 | 334 | /** 335 | * Called when the socket has received the requested datagram. 336 | * 337 | * Due to the nature of UDP, you may occasionally receive undesired packets. 338 | * These may be rogue UDP packets from unknown hosts, 339 | * or they may be delayed packets arriving after retransmissions have already occurred. 340 | * It's important these packets are properly ignored, while not interfering with the flow of your implementation. 341 | * As an aid, this delegate method has a boolean return value. 342 | * If you ever need to ignore a received packet, simply return NO, 343 | * and AsyncUdpSocket will continue as if the packet never arrived. 344 | * That is, the original receive request will still be queued, and will still timeout as usual if a timeout was set. 345 | * For example, say you requested to receive data, and you set a timeout of 500 milliseconds, using a tag of 15. 346 | * If rogue data arrives after 250 milliseconds, this delegate method would be invoked, and you could simply return NO. 347 | * If the expected data then arrives within the next 250 milliseconds, 348 | * this delegate method will be invoked, with a tag of 15, just as if the rogue data never appeared. 349 | * 350 | * Under normal circumstances, you simply return YES from this method. 351 | **/ 352 | - (BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port; 353 | 354 | /** 355 | * Called if an error occurs while trying to receive a requested datagram. 356 | * This is generally due to a timeout, but could potentially be something else if some kind of OS error occurred. 357 | **/ 358 | - (void)onUdpSocket:(AsyncUdpSocket *)sock didNotReceiveDataWithTag:(long)tag dueToError:(NSError *)error; 359 | 360 | /** 361 | * Called when the socket is closed. 362 | * A socket is only closed if you explicitly call one of the close methods. 363 | **/ 364 | - (void)onUdpSocketDidClose:(AsyncUdpSocket *)sock; 365 | 366 | @end 367 | -------------------------------------------------------------------------------- /DerivedData/serialCommunication/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/DerivedData/serialCommunication/.DS_Store -------------------------------------------------------------------------------- /DerivedData/serialCommunication/Build/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/DerivedData/serialCommunication/Build/.DS_Store -------------------------------------------------------------------------------- /DerivedData/serialCommunication/Build/Products/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/DerivedData/serialCommunication/Build/Products/.DS_Store -------------------------------------------------------------------------------- /DerivedData/serialCommunication/Build/Products/Debug-framework/SerialCommunication.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /DerivedData/serialCommunication/Build/Products/Debug-framework/SerialCommunication.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /DerivedData/serialCommunication/Build/Products/Debug-framework/SerialCommunication.framework/SerialCommunication: -------------------------------------------------------------------------------- 1 | Versions/Current/SerialCommunication -------------------------------------------------------------------------------- /DerivedData/serialCommunication/Build/Products/Debug-framework/SerialCommunication.framework/Versions/A/Headers/SerialCommunication.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SerialCommunication.framework for iOS 3 | * SerialCommunication.h 4 | * 5 | * Copyright (c) Yusuke Sekikawa, 11/06/02 6 | * All rights reserved. 7 | * 8 | * BSD License 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, are 11 | * permitted provided that the following conditions are met: 12 | * - Redistributions of source code must retain the above copyright notice, this list of 13 | * conditions and the following disclaimer. 14 | * - Redistributions in binary form must reproduce the above copyright notice, this list 15 | * of conditions and the following disclaimer in the documentation and/or other materia 16 | * ls provided with the distribution. 17 | * - Neither the name of the "Yusuke Sekikawa" nor the names of its contributors may be u 18 | * sed to endorse or promote products derived from this software without specific prior 19 | * written permission. 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY E 21 | * XPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES O 22 | * F MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SH 23 | * ALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENT 24 | * AL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROC 25 | * UREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS I 26 | * NTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI 27 | * CT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF T 28 | * HE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | // For more info 32 | // GitHub 33 | // http://devdot.wikispaces.com/Iphone+Serial+Port+Tutorial 34 | 35 | 36 | #import 37 | 38 | #define TYPE_SERVER 0x01 39 | #define TYPE_CLIENT 0x02 40 | #define TYPE_LOCAL 0x03 41 | 42 | 43 | 44 | @class AsyncSocket; 45 | 46 | @protocol SerialCommunicationDelegate; 47 | 48 | @interface SerialCommunication : NSObject { 49 | id delegate; 50 | int serialFD; 51 | int socketType; 52 | BOOL isServing; 53 | 54 | AsyncSocket *serialSocket; 55 | NSMutableArray *connectedClients; 56 | bool running; 57 | } 58 | @property (nonatomic, assign) id delegate; 59 | @property (readonly,getter=isRunning) bool running; 60 | - (id)initWithType:(uint8_t)type; 61 | - (void) startOnPort:(int)port; 62 | - (void) stop; 63 | - (BOOL)isDeviceConnected; 64 | - (int)sendSerialData:(uint32_t)data; 65 | - (void)normalConnectTo:(NSString*)host port:(int)port; 66 | - (NSString *) wanAddress; 67 | - (NSString *) wifiAddress; 68 | @end 69 | 70 | @protocol SerialCommunicationDelegate 71 | -(void)serialDataRecieved:(int)data; 72 | -(void)serialAlert:(NSString*)msg; 73 | -(void)disconnectedWithPeer; 74 | -(void)connectedWithPeer:(BOOL)result; 75 | @end 76 | -------------------------------------------------------------------------------- /DerivedData/serialCommunication/Build/Products/Debug-framework/SerialCommunication.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | SerialCommunication 9 | CFBundleGetInfoString 10 | ImageProcessing 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yusukesekikawa.SerialCommunication 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | SerialCommunication 19 | CFBundlePackageType 20 | FMWK 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | NSHumanReadableCopyright 28 | Copyright © 2011 YusukeSekikawa. All rights reserved. 29 | NSPrincipalClass 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /DerivedData/serialCommunication/Build/Products/Debug-framework/SerialCommunication.framework/Versions/A/SerialCommunication: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/DerivedData/serialCommunication/Build/Products/Debug-framework/SerialCommunication.framework/Versions/A/SerialCommunication -------------------------------------------------------------------------------- /DerivedData/serialCommunication/Build/Products/Debug-framework/SerialCommunication.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | SerialCommunication 9 | CFBundleGetInfoString 10 | ImageProcessing 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yusukesekikawa.SerialCommunication 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | SerialCommunication 19 | CFBundlePackageType 20 | FMWK 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | NSHumanReadableCopyright 28 | Copyright © 2011 YusukeSekikawa. All rights reserved. 29 | NSPrincipalClass 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](http://vanishlab.web.fc2.com/vanishlab/OSS_files/chip.png) 2 | FEATURE 3 | ======= 4 | You can easily control Arduino using iOS devices. 5 | You can build and Run using Xcode as you create normal project.
6 | This is iOS version of Android NDK.
7 | (This framework use UART,Android ADK uses USB)
8 | Using this framework and method Arduino can power from iOS devices. 9 | 10 | [NEW] 11 | It also provide remote control over 3G or Wifi,that you can control Arduino in remotely. 12 | 13 | 14 | 15 | [JP]
16 | XCodeを使ってビルド&実行できる環境で簡単にArduinoと通信するアプリを開発できます。
17 | iOS版のAndroid ADKみたいな感じの環境ができればなと思って開発しています。
18 | ADKより、いい点は、USBじゃなくてUARTなので通信がシンプルなのと、デバイスから電源をもらえるので(限度はありますが、、)構成がシンプルになる点です。
19 | 20 | ![](http://blog-imgs-42.fc2.com/v/a/n/vanishlab/201106232358095ce.png) 21 | 22 | Setting Up H/W 23 | ======= 24 | See [iPhone Pinout] and,connect TX,RX,GND,Vcc(optional) with Arduino
25 | Note that use 3.3V version of Arduino when connecting with iOS devieces.
26 | You can use this(http://www.sparkfun.com/products/633) or this(http://www.sparkfun.com/products/8295)
27 | For more info about iOS Serial port check [iPhone Serial Port Tutorial]
28 | You can easily build development boards with the help of the sample code in yourself,or you can build your favorite,or you can even use " Android Open Accessory compatible development boards" and connect to iOS with TX,RX and GND. 29 | 30 | [JP]
31 | [iPhone Pinout] を参考にして、TX,RX,GND,Vcc(optional) をArduinoと接続してください。
32 | 電源をデバイスから取りたい場合には、3.3V品のArduinoを使ってください。.
33 | DockConnectorとの接続には、秋葉原とかで売っている工作用のを使うか、手持ちのいらないケーブルを分解してもOKです。
34 | DocKコネクタを経由したシリアル通信について、詳しく知りたい方は[iPhone Serial Port Tutorial]を参考にしてください。
35 | /Arduino(iOS ADK sample)/iOS_ADKArduino/iOS_ADK.pde を開いて、付属のファームウェアを転送してください。
36 | サンプルコードに対応したdevelopment boardsは上記コードを参考に簡単に組み立てることもできますし、ちょっと高いですがAndroid-ADKを購入し、シリアル端子を付けてもOKです。
37 | 38 | 39 | Setting Up iOS 40 | ======= 41 | 1.jailbreak your iOS device.
42 | More info about Jailbreak visit [Dev-Team]
43 | 2.Add read,and execute to everyone for /dev/tty.iap
44 | 3.Download this Project and open SerialCommunicationFramework/SerialCommunicationSkeleton/SerialCommunicationSkeleton.xcodeproj
45 | 4.Buil and Run.
46 | 5.Connect Arduino.
47 | For more info about this frame work see source code in Project files.
48 | 49 | [JP]
50 | 1.デバイスをJailbreakします。
51 | 2./dev/tty.iapにユーザのExecuteとRead権限を付加します。(CydiaにあるiFileを使うと簡単です)
52 | 3.このプロジェクトをダウンロードし、SerialCommunicationFramework/SerialCommunicationSkeleton/SerialCommunicationSkeleton.xcodeproj を開きます。
53 | 4.Buil and Run.
54 | 5.上で作成したケーブルを介してArduinoを接続すれば動くはずです。
55 | 56 | 57 | How to use remote controll function with sample project, 58 | ======= 59 | [Server]
60 | 1.Connect Arduino.
61 | 2.Home->Settings->ADK Select Server
62 | 3.Lunch App.
63 | 64 | [Client]
65 | 1.Home->Settings->ADK Select Clinet
66 | 2.Lunch App.
67 | 3.Input IP Address shown in server side App and push connect. 68 | $.Background color turns black when successfully connected with server.(Server side also turns black) 69 | 70 | 71 | 72 | [JP]
73 | 1.Arduinoを接続します。.
74 | 2.Home->Settings->ADK でServerを選択します。
75 | 3.アプリケーションを起動します.
76 | 77 | [Client]
78 | 1.Home->Settings->ADK でClinetを選択します。
79 | 2.アプリケーションを起動します.
80 | 3.Server側の画面に表示されているIPアドレスを入力してconnectを押します。 81 | $.正常に接続されると、背景が赤から黒に変わります。(サーバー側も同様に黒になります) 82 | 83 | Limitations 84 | ======= 85 | 86 | [JP]
87 | 0xffを同期用の信号として使用しているため、現在、iOS->Arduinoにおくる値として、0xffが使用できません。
88 | 将来的には、現在の4Byteパケットの構成はかえないまま0xffを使用可能になるように修正する予定です。 89 | 90 | 91 | Update Plan 92 | ======= 93 | In update I want to add direct socket access feature from remote device in same network. 94 | I commented out draft code in "SerialCommunication.m",someone please implement this feature. 95 | 96 | Reference 97 | ======= 98 | http://hcgilje.wordpress.com/2010/02/15/iphone-serial-communication/
99 | 100 | 101 | HP 102 | ======= 103 | [vanishlab] 104 | 105 | Contacts 106 | ======= 107 | [facebook]
108 | [twitter] 109 | 110 | Dependency 111 | ======= 112 | Accelerate.framework 113 | 114 | Acknowledgement 115 | ======= 116 | 117 | License 118 | ======= 119 | BSD License. 120 | 121 | Gallery 122 | ======= 123 | BSD License. 124 | ![](http://blog-imgs-42.fc2.com/v/a/n/vanishlab/20110625121707c2a.jpg) 125 | 126 | 127 | [Dev-Team]: http://blog.iphone-dev.org/ 128 | [vanishlab]: http://vanishlab.web.fc2.com/ 129 | [BSD License]: http://www.opensource.org/licenses/bsd-license.php 130 | [facebook]: http://www.facebook.com/yusuke.sekikawa 131 | [twitter]: http://twitter.com/#!/YusukeSekikawa 132 | [iPhone Pinout]: http://pinouts.ru/Devices/ipod_pinout.shtml 133 | [iPhone Serial Port Tutorial]: http://devdot.wikispaces.com/Iphone+Serial+Port+Tutorial -------------------------------------------------------------------------------- /Serial/Makefile: -------------------------------------------------------------------------------- 1 | CC=/usr/local/bin/arm-apple-darwin-gcc -v 2 | CXX=/usr/local/bin/arm-apple-darwin-g++ 3 | TARGET=serial 4 | LD=$(CC) 5 | LDFLAGS = -framework CoreFoundation \ 6 | -framework Foundation \ 7 | -framework UIKit \ 8 | -framework LayerKit \ 9 | -framework CoreGraphics \ 10 | -framework GraphicsServices \ 11 | -framework CoreSurface \ 12 | -lobjc 13 | 14 | all: $(TARGET) 15 | 16 | Hello: $(TARGET).o 17 | $(LD) $(LDFLAGS) -o $@ $^ 18 | 19 | %.o: %.m 20 | $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 21 | 22 | clean: 23 | rm -f *.o $(TARGET) 24 | 25 | -------------------------------------------------------------------------------- /Serial/serial: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/Serial/serial -------------------------------------------------------------------------------- /Serial/serial.c: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // Iphone Serial I/O demo. see DevDot.wikispaces.com for more info 3 | // --------------------------------------------------------------------------------------- 4 | // By Collin Meyer (TheRain) 5 | // 12-09-2007 revision 1 6 | // Feel free to reuse this code. 7 | ////////////////////////////////////////////////////////////////////////// 8 | 9 | 10 | #include /* Standard input/output definitions */ 11 | #include /* String function definitions */ 12 | #include /* UNIX standard function definitions */ 13 | #include /* File control definitions */ 14 | #include /* Error number definitions */ 15 | #include /* POSIX terminal control definitions */ 16 | 17 | static struct termios gOriginalTTYAttrs; 18 | 19 | int OpenSerialPort() 20 | { 21 | int fileDescriptor = -1; 22 | struct termios options; 23 | 24 | // Open the serial port read/write, with no controlling terminal, and don't wait for a connection. 25 | // The O_NONBLOCK flag also causes subsequent I/O on the device to be non-blocking. 26 | // See open(2) ("man 2 open") for details. 27 | 28 | fileDescriptor = open("/dev/tty.iap", O_RDWR | O_NOCTTY | O_NONBLOCK); 29 | if (fileDescriptor == -1) 30 | { 31 | printf("Error opening serial port %s - %s(%d).\n", 32 | "/dev/tty.iap", strerror(errno), errno); 33 | goto error; 34 | } 35 | 36 | // Note that open() follows POSIX semantics: multiple open() calls to the same file will succeed 37 | // unless the TIOCEXCL ioctl is issued. This will prevent additional opens except by root-owned 38 | // processes. 39 | // See tty(4) ("man 4 tty") and ioctl(2) ("man 2 ioctl") for details. 40 | 41 | if (ioctl(fileDescriptor, TIOCEXCL) == -1) 42 | { 43 | printf("Error setting TIOCEXCL on %s - %s(%d).\n", 44 | "/dev/tty.iap", strerror(errno), errno); 45 | goto error; 46 | } 47 | 48 | // Now that the device is open, clear the O_NONBLOCK flag so subsequent I/O will block. 49 | // See fcntl(2) ("man 2 fcntl") for details. 50 | 51 | if (fcntl(fileDescriptor, F_SETFL, 0) == -1) 52 | { 53 | printf("Error clearing O_NONBLOCK %s - %s(%d).\n", 54 | "/dev/tty.iap", strerror(errno), errno); 55 | goto error; 56 | } 57 | 58 | // Get the current options and save them so we can restore the default settings later. 59 | if (tcgetattr(fileDescriptor, &gOriginalTTYAttrs) == -1) 60 | { 61 | printf("Error getting tty attributes %s - %s(%d).\n", 62 | "/dev/tty.iap", strerror(errno), errno); 63 | goto error; 64 | } 65 | 66 | // The serial port attributes such as timeouts and baud rate are set by modifying the termios 67 | // structure and then calling tcsetattr() to cause the changes to take effect. Note that the 68 | // changes will not become effective without the tcsetattr() call. 69 | // See tcsetattr(4) ("man 4 tcsetattr") for details. 70 | 71 | options = gOriginalTTYAttrs; 72 | 73 | // Print the current input and output baud rates. 74 | // See tcsetattr(4) ("man 4 tcsetattr") for details. 75 | 76 | printf("Current input baud rate is %d\n", (int) cfgetispeed(&options)); 77 | printf("Current output baud rate is %d\n", (int) cfgetospeed(&options)); 78 | 79 | // Set raw input (non-canonical) mode, with reads blocking until either a single character 80 | // has been received or a one second timeout expires. 81 | // See tcsetattr(4) ("man 4 tcsetattr") and termios(4) ("man 4 termios") for details. 82 | 83 | cfmakeraw(&options); 84 | options.c_cc[VMIN] = 1; 85 | options.c_cc[VTIME] = 10; 86 | 87 | // The baud rate, word length, and handshake options can be set as follows: 88 | 89 | cfsetspeed(&options, B9600); // Set 19200 baud 90 | options.c_cflag |= (CS8); // RTS flow control of input 91 | 92 | 93 | printf("Input baud rate changed to %d\n", (int) cfgetispeed(&options)); 94 | printf("Output baud rate changed to %d\n", (int) cfgetospeed(&options)); 95 | 96 | // Cause the new options to take effect immediately. 97 | if (tcsetattr(fileDescriptor, TCSANOW, &options) == -1) 98 | { 99 | printf("Error setting tty attributes %s - %s(%d).\n", 100 | "/dev/tty.iap", strerror(errno), errno); 101 | goto error; 102 | } 103 | // Success 104 | return fileDescriptor; 105 | 106 | // Failure "/dev/tty.iap" 107 | error: 108 | if (fileDescriptor != -1) 109 | { 110 | close(fileDescriptor); 111 | } 112 | 113 | return -1; 114 | } 115 | -------------------------------------------------------------------------------- /Serial/serial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * serial.h 3 | * LEDBAG 4 | * 5 | * Created by sekikawa yusuke on 12/5/09. 6 | * Copyright 2009 __MyCompanyName__. All rights reserved. 7 | * 8 | */ 9 | int OpenSerialPort(void); 10 | -------------------------------------------------------------------------------- /SerialCommunicationSkeleton.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/SerialCommunicationSkeleton.zip -------------------------------------------------------------------------------- /image/SerialCommunicationframework APP image.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/image/SerialCommunicationframework APP image.PNG -------------------------------------------------------------------------------- /image/iOS ADK.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/image/iOS ADK.jpg -------------------------------------------------------------------------------- /image/iOS ADK_S.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yusukeSekikawa/SerialCommunicationFramework/276d734be0eb9cca983ac7454dab4c10e74b35dd/image/iOS ADK_S.jpg -------------------------------------------------------------------------------- /serialCommunication-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'serialInput' target in the 'serialInput' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | EB1017AB13B1CF4E00BB1129 /* SerialCommunication.h in Headers */ = {isa = PBXBuildFile; fileRef = EB1017A913B1CF4E00BB1129 /* SerialCommunication.h */; }; 11 | EB1017AC13B1CF4E00BB1129 /* SerialCommunication.m in Sources */ = {isa = PBXBuildFile; fileRef = EB1017AA13B1CF4E00BB1129 /* SerialCommunication.m */; }; 12 | EB10180513B1E27B00BB1129 /* serialCommunication-Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = EB10180413B1E27B00BB1129 /* serialCommunication-Prefix.pch */; }; 13 | EB45FE4313CFDE83004CDAB5 /* AsyncSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = EB45FE3F13CFDE83004CDAB5 /* AsyncSocket.h */; }; 14 | EB45FE4413CFDE83004CDAB5 /* AsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = EB45FE4013CFDE83004CDAB5 /* AsyncSocket.m */; }; 15 | EB45FE4513CFDE83004CDAB5 /* AsyncUdpSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = EB45FE4113CFDE83004CDAB5 /* AsyncUdpSocket.h */; }; 16 | EB45FE4613CFDE83004CDAB5 /* AsyncUdpSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = EB45FE4213CFDE83004CDAB5 /* AsyncUdpSocket.m */; }; 17 | EB45FE4A13CFDFF5004CDAB5 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EB45FE4913CFDFF5004CDAB5 /* CFNetwork.framework */; }; 18 | EB72C66613694CB30044490D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EB72C66513694CB30044490D /* Foundation.framework */; }; 19 | EB72C6A113694E110044490D /* Makefile in Sources */ = {isa = PBXBuildFile; fileRef = EB72C69D13694E110044490D /* Makefile */; }; 20 | EB72C6A213694E110044490D /* serial.c in Sources */ = {isa = PBXBuildFile; fileRef = EB72C69F13694E110044490D /* serial.c */; }; 21 | EB72C6A313694E110044490D /* serial.h in Headers */ = {isa = PBXBuildFile; fileRef = EB72C6A013694E110044490D /* serial.h */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | EB1017A913B1CF4E00BB1129 /* SerialCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SerialCommunication.h; path = Classes/SerialCommunication.h; sourceTree = SOURCE_ROOT; }; 26 | EB1017AA13B1CF4E00BB1129 /* SerialCommunication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SerialCommunication.m; path = Classes/SerialCommunication.m; sourceTree = SOURCE_ROOT; }; 27 | EB1017C413B1DD1100BB1129 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; 28 | EB10180413B1E27B00BB1129 /* serialCommunication-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "serialCommunication-Prefix.pch"; sourceTree = ""; }; 29 | EB45FE3F13CFDE83004CDAB5 /* AsyncSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsyncSocket.h; path = Classes/cocoaasyncsocket/AsyncSocket.h; sourceTree = SOURCE_ROOT; }; 30 | EB45FE4013CFDE83004CDAB5 /* AsyncSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AsyncSocket.m; path = Classes/cocoaasyncsocket/AsyncSocket.m; sourceTree = SOURCE_ROOT; }; 31 | EB45FE4113CFDE83004CDAB5 /* AsyncUdpSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsyncUdpSocket.h; path = Classes/cocoaasyncsocket/AsyncUdpSocket.h; sourceTree = SOURCE_ROOT; }; 32 | EB45FE4213CFDE83004CDAB5 /* AsyncUdpSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AsyncUdpSocket.m; path = Classes/cocoaasyncsocket/AsyncUdpSocket.m; sourceTree = SOURCE_ROOT; }; 33 | EB45FE4913CFDFF5004CDAB5 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; 34 | EB72C66213694CB30044490D /* libserialCommunication.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libserialCommunication.a; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | EB72C66513694CB30044490D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 36 | EB72C67013694CB30044490D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 37 | EB72C67313694CB30044490D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 38 | EB72C69D13694E110044490D /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = Serial/Makefile; sourceTree = SOURCE_ROOT; }; 39 | EB72C69E13694E110044490D /* serial */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = serial; path = Serial/serial; sourceTree = SOURCE_ROOT; }; 40 | EB72C69F13694E110044490D /* serial.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = serial.c; path = Serial/serial.c; sourceTree = SOURCE_ROOT; }; 41 | EB72C6A013694E110044490D /* serial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = serial.h; path = Serial/serial.h; sourceTree = SOURCE_ROOT; }; 42 | /* End PBXFileReference section */ 43 | 44 | /* Begin PBXFrameworksBuildPhase section */ 45 | EB72C65F13694CB30044490D /* Frameworks */ = { 46 | isa = PBXFrameworksBuildPhase; 47 | buildActionMask = 2147483647; 48 | files = ( 49 | EB45FE4A13CFDFF5004CDAB5 /* CFNetwork.framework in Frameworks */, 50 | EB72C66613694CB30044490D /* Foundation.framework in Frameworks */, 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | /* End PBXFrameworksBuildPhase section */ 55 | 56 | /* Begin PBXGroup section */ 57 | EB1017C313B1DCF100BB1129 /* Resources */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | EB1017C413B1DD1100BB1129 /* Info.plist */, 61 | ); 62 | name = Resources; 63 | path = serialInput; 64 | sourceTree = ""; 65 | }; 66 | EB45FE4813CFDE90004CDAB5 /* cocoaasyncsocket */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | EB45FE3F13CFDE83004CDAB5 /* AsyncSocket.h */, 70 | EB45FE4013CFDE83004CDAB5 /* AsyncSocket.m */, 71 | EB45FE4113CFDE83004CDAB5 /* AsyncUdpSocket.h */, 72 | EB45FE4213CFDE83004CDAB5 /* AsyncUdpSocket.m */, 73 | ); 74 | name = cocoaasyncsocket; 75 | sourceTree = ""; 76 | }; 77 | EB72C65713694CB20044490D = { 78 | isa = PBXGroup; 79 | children = ( 80 | EB10180413B1E27B00BB1129 /* serialCommunication-Prefix.pch */, 81 | EB1017C313B1DCF100BB1129 /* Resources */, 82 | EB72C69C13694DFA0044490D /* serial */, 83 | EB72C68E13694CDA0044490D /* classes */, 84 | EB72C66413694CB30044490D /* Frameworks */, 85 | EB72C66313694CB30044490D /* Products */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | EB72C66313694CB30044490D /* Products */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | EB72C66213694CB30044490D /* libserialCommunication.a */, 93 | ); 94 | name = Products; 95 | sourceTree = ""; 96 | }; 97 | EB72C66413694CB30044490D /* Frameworks */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | EB45FE4913CFDFF5004CDAB5 /* CFNetwork.framework */, 101 | EB72C66513694CB30044490D /* Foundation.framework */, 102 | EB72C67013694CB30044490D /* UIKit.framework */, 103 | EB72C67313694CB30044490D /* CoreGraphics.framework */, 104 | ); 105 | name = Frameworks; 106 | sourceTree = ""; 107 | }; 108 | EB72C68E13694CDA0044490D /* classes */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | EB45FE4813CFDE90004CDAB5 /* cocoaasyncsocket */, 112 | EB1017A913B1CF4E00BB1129 /* SerialCommunication.h */, 113 | EB1017AA13B1CF4E00BB1129 /* SerialCommunication.m */, 114 | ); 115 | name = classes; 116 | path = serialInputTests; 117 | sourceTree = ""; 118 | }; 119 | EB72C69C13694DFA0044490D /* serial */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | EB72C69D13694E110044490D /* Makefile */, 123 | EB72C69E13694E110044490D /* serial */, 124 | EB72C69F13694E110044490D /* serial.c */, 125 | EB72C6A013694E110044490D /* serial.h */, 126 | ); 127 | name = serial; 128 | path = serialInput; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXHeadersBuildPhase section */ 134 | EB72C66013694CB30044490D /* Headers */ = { 135 | isa = PBXHeadersBuildPhase; 136 | buildActionMask = 2147483647; 137 | files = ( 138 | EB72C6A313694E110044490D /* serial.h in Headers */, 139 | EB1017AB13B1CF4E00BB1129 /* SerialCommunication.h in Headers */, 140 | EB10180513B1E27B00BB1129 /* serialCommunication-Prefix.pch in Headers */, 141 | EB45FE4313CFDE83004CDAB5 /* AsyncSocket.h in Headers */, 142 | EB45FE4513CFDE83004CDAB5 /* AsyncUdpSocket.h in Headers */, 143 | ); 144 | runOnlyForDeploymentPostprocessing = 0; 145 | }; 146 | /* End PBXHeadersBuildPhase section */ 147 | 148 | /* Begin PBXNativeTarget section */ 149 | EB72C66113694CB30044490D /* serialCommunication */ = { 150 | isa = PBXNativeTarget; 151 | buildConfigurationList = EB72C68513694CB30044490D /* Build configuration list for PBXNativeTarget "serialCommunication" */; 152 | buildPhases = ( 153 | EB72C65E13694CB30044490D /* Sources */, 154 | EB72C65F13694CB30044490D /* Frameworks */, 155 | EB72C66013694CB30044490D /* Headers */, 156 | EB1017C513B1DD6300BB1129 /* ShellScript */, 157 | ); 158 | buildRules = ( 159 | ); 160 | dependencies = ( 161 | ); 162 | name = serialCommunication; 163 | productName = serialInput; 164 | productReference = EB72C66213694CB30044490D /* libserialCommunication.a */; 165 | productType = "com.apple.product-type.library.static"; 166 | }; 167 | /* End PBXNativeTarget section */ 168 | 169 | /* Begin PBXProject section */ 170 | EB72C65913694CB20044490D /* Project object */ = { 171 | isa = PBXProject; 172 | buildConfigurationList = EB72C65C13694CB20044490D /* Build configuration list for PBXProject "serialCommunication" */; 173 | compatibilityVersion = "Xcode 3.2"; 174 | developmentRegion = English; 175 | hasScannedForEncodings = 0; 176 | knownRegions = ( 177 | en, 178 | ); 179 | mainGroup = EB72C65713694CB20044490D; 180 | productRefGroup = EB72C66313694CB30044490D /* Products */; 181 | projectDirPath = ""; 182 | projectRoot = ""; 183 | targets = ( 184 | EB72C66113694CB30044490D /* serialCommunication */, 185 | ); 186 | }; 187 | /* End PBXProject section */ 188 | 189 | /* Begin PBXShellScriptBuildPhase section */ 190 | EB1017C513B1DD6300BB1129 /* ShellScript */ = { 191 | isa = PBXShellScriptBuildPhase; 192 | buildActionMask = 2147483647; 193 | files = ( 194 | ); 195 | inputPaths = ( 196 | ); 197 | outputPaths = ( 198 | ); 199 | runOnlyForDeploymentPostprocessing = 0; 200 | shellPath = /bin/sh; 201 | shellScript = "#--------------------------------------------------------------------\necho \"[0] Framework: Preparing ...\"\n#--------------------------------------------------------------------\nFRAMEWORK_NAME=$(/usr/libexec/PlistBuddy -c \"Print CFBundleName\" Info.plist)\nBUILD_TARGET_NAME=$FRAMEWORK_NAME\nFRAMEWORK_VERSION_NUMBER=$(/usr/libexec/PlistBuddy -c \"Print CFBundleShortVersionString\" Info.plist)\nFRAMEWORK_VERSION=A\nFRAMEWORK_BUILD_PATH=\"DerivedData/${BUILD_TARGET_NAME}/Build/Products/${BUILD_STYLE}-framework\"\nFRAMEWORK_DIR=\"${FRAMEWORK_BUILD_PATH}/${FRAMEWORK_NAME}.framework\"\nPACKAGENAME=\"${FRAMEWORK_NAME}.${FRAMEWORK_VERSION_NUMBER}.zip\"\n\n\necho \"Framework: Cleaning framework...\"\n[ -d \"${FRAMEWORK_BUILD_PATH}\" ] && rm -rf \"${FRAMEWORK_BUILD_PATH}\"\n\n#--------------------------------------------------------------------\necho \"[1] Framework: Setting up directories...\"\n#--------------------------------------------------------------------\nmkdir -p ${FRAMEWORK_DIR}\nmkdir -p ${FRAMEWORK_DIR}/Versions\nmkdir -p ${FRAMEWORK_DIR}/Versions/${FRAMEWORK_VERSION}\nmkdir -p ${FRAMEWORK_DIR}/Versions/${FRAMEWORK_VERSION}/Resources\nmkdir -p ${FRAMEWORK_DIR}/Versions/${FRAMEWORK_VERSION}/Headers\n\n#--------------------------------------------------------------------\necho \"[2] Framework: Creating symlinks...\"\n#--------------------------------------------------------------------\nln -s ${FRAMEWORK_VERSION} ${FRAMEWORK_DIR}/Versions/Current\nln -s Versions/Current/Headers ${FRAMEWORK_DIR}/Headers\nln -s Versions/Current/Resources ${FRAMEWORK_DIR}/Resources\nln -s Versions/Current/${FRAMEWORK_NAME} ${FRAMEWORK_DIR}/${FRAMEWORK_NAME}\n\n#--------------------------------------------------------------------\necho \"[3] Framework: Creating library...\"\n#--------------------------------------------------------------------\nlipo -create \\\nDerivedData/${BUILD_TARGET_NAME}/Build/Products/${BUILD_STYLE}-iphoneos/lib${FRAMEWORK_NAME}.a \\\n-o \"${FRAMEWORK_DIR}/Versions/Current/${FRAMEWORK_NAME}\"\n#build/${BUILD_STYLE}-iphonesimulator/lib${FRAMEWORK_NAME}.a \\\n\n#--------------------------------------------------------------------\necho \"[4] Framework: Copying assets into current version...\"\n#--------------------------------------------------------------------\ncp Classes/*.h ${FRAMEWORK_DIR}/Headers/\ncp Info.plist ${FRAMEWORK_DIR}/Resources/ \n#--------------------------------------------------------------------\necho \"[6] Framework: Packaging framework...\"\n#--------------------------------------------------------------------\n#cd ${FRAMEWORK_BUILD_PATH}\n#zip -ry ${PACKAGENAME} $(basename $FRAMEWORK_DIR)\n"; 202 | }; 203 | /* End PBXShellScriptBuildPhase section */ 204 | 205 | /* Begin PBXSourcesBuildPhase section */ 206 | EB72C65E13694CB30044490D /* Sources */ = { 207 | isa = PBXSourcesBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | EB72C6A113694E110044490D /* Makefile in Sources */, 211 | EB72C6A213694E110044490D /* serial.c in Sources */, 212 | EB1017AC13B1CF4E00BB1129 /* SerialCommunication.m in Sources */, 213 | EB45FE4413CFDE83004CDAB5 /* AsyncSocket.m in Sources */, 214 | EB45FE4613CFDE83004CDAB5 /* AsyncUdpSocket.m in Sources */, 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | }; 218 | /* End PBXSourcesBuildPhase section */ 219 | 220 | /* Begin XCBuildConfiguration section */ 221 | EB72C68313694CB30044490D /* Debug */ = { 222 | isa = XCBuildConfiguration; 223 | buildSettings = { 224 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 225 | GCC_C_LANGUAGE_STANDARD = gnu99; 226 | GCC_OPTIMIZATION_LEVEL = 0; 227 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 228 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 229 | GCC_VERSION = com.apple.compilers.llvmgcc42; 230 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 231 | GCC_WARN_UNUSED_VARIABLE = YES; 232 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 233 | SDKROOT = iphoneos; 234 | }; 235 | name = Debug; 236 | }; 237 | EB72C68413694CB30044490D /* Release */ = { 238 | isa = XCBuildConfiguration; 239 | buildSettings = { 240 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 241 | GCC_C_LANGUAGE_STANDARD = gnu99; 242 | GCC_VERSION = com.apple.compilers.llvmgcc42; 243 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 244 | GCC_WARN_UNUSED_VARIABLE = YES; 245 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 246 | SDKROOT = iphoneos; 247 | }; 248 | name = Release; 249 | }; 250 | EB72C68613694CB30044490D /* Debug */ = { 251 | isa = XCBuildConfiguration; 252 | buildSettings = { 253 | ALWAYS_SEARCH_USER_PATHS = NO; 254 | DSTROOT = /tmp/serialInput.dst; 255 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 256 | GCC_PREFIX_HEADER = "serialCommunication-Prefix.pch"; 257 | OTHER_LDFLAGS = "-ObjC"; 258 | PRODUCT_NAME = serialCommunication; 259 | }; 260 | name = Debug; 261 | }; 262 | EB72C68713694CB30044490D /* Release */ = { 263 | isa = XCBuildConfiguration; 264 | buildSettings = { 265 | ALWAYS_SEARCH_USER_PATHS = NO; 266 | DSTROOT = /tmp/serialInput.dst; 267 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 268 | GCC_PREFIX_HEADER = "serialCommunication-Prefix.pch"; 269 | OTHER_LDFLAGS = "-ObjC"; 270 | PRODUCT_NAME = serialCommunication; 271 | }; 272 | name = Release; 273 | }; 274 | /* End XCBuildConfiguration section */ 275 | 276 | /* Begin XCConfigurationList section */ 277 | EB72C65C13694CB20044490D /* Build configuration list for PBXProject "serialCommunication" */ = { 278 | isa = XCConfigurationList; 279 | buildConfigurations = ( 280 | EB72C68313694CB30044490D /* Debug */, 281 | EB72C68413694CB30044490D /* Release */, 282 | ); 283 | defaultConfigurationIsVisible = 0; 284 | defaultConfigurationName = Release; 285 | }; 286 | EB72C68513694CB30044490D /* Build configuration list for PBXNativeTarget "serialCommunication" */ = { 287 | isa = XCConfigurationList; 288 | buildConfigurations = ( 289 | EB72C68613694CB30044490D /* Debug */, 290 | EB72C68713694CB30044490D /* Release */, 291 | ); 292 | defaultConfigurationIsVisible = 0; 293 | defaultConfigurationName = Release; 294 | }; 295 | /* End XCConfigurationList section */ 296 | }; 297 | rootObject = EB72C65913694CB20044490D /* Project object */; 298 | } 299 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/project.xcworkspace/xcuserdata/sekikawayusuke.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/project.xcworkspace/xcuserdata/yusukesekikawa.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $archiver 6 | NSKeyedArchiver 7 | $objects 8 | 9 | $null 10 | 11 | $class 12 | 13 | CF$UID 14 | 105 15 | 16 | NS.keys 17 | 18 | 19 | CF$UID 20 | 2 21 | 22 | 23 | CF$UID 24 | 3 25 | 26 | 27 | NS.objects 28 | 29 | 30 | CF$UID 31 | 4 32 | 33 | 34 | CF$UID 35 | 79 36 | 37 | 38 | 39 | IDEWorkspaceDocument 40 | B79DC732-B5D3-43EE-970F-E289EE870A57 41 | 42 | $class 43 | 44 | CF$UID 45 | 31 46 | 47 | NS.keys 48 | 49 | 50 | CF$UID 51 | 5 52 | 53 | 54 | CF$UID 55 | 6 56 | 57 | 58 | CF$UID 59 | 7 60 | 61 | 62 | CF$UID 63 | 8 64 | 65 | 66 | CF$UID 67 | 9 68 | 69 | 70 | CF$UID 71 | 10 72 | 73 | 74 | CF$UID 75 | 11 76 | 77 | 78 | CF$UID 79 | 12 80 | 81 | 82 | CF$UID 83 | 13 84 | 85 | 86 | CF$UID 87 | 14 88 | 89 | 90 | NS.objects 91 | 92 | 93 | CF$UID 94 | 15 95 | 96 | 97 | CF$UID 98 | 16 99 | 100 | 101 | CF$UID 102 | 32 103 | 104 | 105 | CF$UID 106 | 33 107 | 108 | 109 | CF$UID 110 | 36 111 | 112 | 113 | CF$UID 114 | 41 115 | 116 | 117 | CF$UID 118 | 75 119 | 120 | 121 | CF$UID 122 | 76 123 | 124 | 125 | CF$UID 126 | 15 127 | 128 | 129 | CF$UID 130 | 15 131 | 132 | 133 | 134 | BreakpointsActivated 135 | DefaultEditorStatesForURLs 136 | DebuggingWindowBehavior 137 | ActiveScheme 138 | ActiveRunDestination 139 | LastCompletedPersistentSchemeBasedActivityReport 140 | DocumentWindows 141 | RecentEditorDocumentURLs 142 | AppFocusInMiniDebugging 143 | MiniDebuggingConsole 144 | 145 | 146 | $class 147 | 148 | CF$UID 149 | 31 150 | 151 | NS.keys 152 | 153 | 154 | CF$UID 155 | 17 156 | 157 | 158 | NS.objects 159 | 160 | 161 | CF$UID 162 | 18 163 | 164 | 165 | 166 | Xcode.IDEKit.EditorDocument.SourceCode 167 | 168 | $class 169 | 170 | CF$UID 171 | 31 172 | 173 | NS.keys 174 | 175 | 176 | CF$UID 177 | 19 178 | 179 | 180 | NS.objects 181 | 182 | 183 | CF$UID 184 | 23 185 | 186 | 187 | 188 | 189 | $class 190 | 191 | CF$UID 192 | 22 193 | 194 | NS.base 195 | 196 | CF$UID 197 | 0 198 | 199 | NS.relative 200 | 201 | CF$UID 202 | 20 203 | 204 | 205 | 206 | $class 207 | 208 | CF$UID 209 | 21 210 | 211 | NS.string 212 | file://localhost/Users/yusukesekikawa/Dropbox/Dev/SerialCommunicationFramework/Classes/SerialCommunication.m 213 | 214 | 215 | $classes 216 | 217 | NSMutableString 218 | NSString 219 | NSObject 220 | 221 | $classname 222 | NSMutableString 223 | 224 | 225 | $classes 226 | 227 | NSURL 228 | NSObject 229 | 230 | $classname 231 | NSURL 232 | 233 | 234 | $class 235 | 236 | CF$UID 237 | 31 238 | 239 | NS.keys 240 | 241 | 242 | CF$UID 243 | 24 244 | 245 | 246 | CF$UID 247 | 25 248 | 249 | 250 | CF$UID 251 | 26 252 | 253 | 254 | CF$UID 255 | 27 256 | 257 | 258 | NS.objects 259 | 260 | 261 | CF$UID 262 | 28 263 | 264 | 265 | CF$UID 266 | 29 267 | 268 | 269 | CF$UID 270 | 15 271 | 272 | 273 | CF$UID 274 | 30 275 | 276 | 277 | 278 | PrimaryDocumentTimestamp 279 | PrimaryDocumentVisibleCharacterRange 280 | HideAllIssues 281 | PrimaryDocumentSelectedCharacterRange 282 | 331614139.23543102 283 | {2965, 999} 284 | {3396, 0} 285 | 286 | $classes 287 | 288 | NSMutableDictionary 289 | NSDictionary 290 | NSObject 291 | 292 | $classname 293 | NSMutableDictionary 294 | 295 | 0 296 | 297 | $class 298 | 299 | CF$UID 300 | 31 301 | 302 | NS.keys 303 | 304 | 305 | CF$UID 306 | 34 307 | 308 | 309 | NS.objects 310 | 311 | 312 | CF$UID 313 | 35 314 | 315 | 316 | 317 | IDENameString 318 | serialCommunication 319 | 320 | $class 321 | 322 | CF$UID 323 | 31 324 | 325 | NS.keys 326 | 327 | 328 | CF$UID 329 | 37 330 | 331 | 332 | CF$UID 333 | 38 334 | 335 | 336 | NS.objects 337 | 338 | 339 | CF$UID 340 | 39 341 | 342 | 343 | CF$UID 344 | 40 345 | 346 | 347 | 348 | IDEDeviceLocation 349 | IDEDeviceArchitecture 350 | dvtdevice-iphonePlaceholder:placeholder 351 | armv7 352 | 353 | $class 354 | 355 | CF$UID 356 | 31 357 | 358 | NS.keys 359 | 360 | 361 | CF$UID 362 | 42 363 | 364 | 365 | CF$UID 366 | 43 367 | 368 | 369 | CF$UID 370 | 44 371 | 372 | 373 | NS.objects 374 | 375 | 376 | CF$UID 377 | 45 378 | 379 | 380 | CF$UID 381 | 73 382 | 383 | 384 | CF$UID 385 | 74 386 | 387 | 388 | 389 | IDEActivityReportCompletionSummaryStringSegments 390 | IDEActivityReportOptions 391 | IDEActivityReportTitle 392 | 393 | $class 394 | 395 | CF$UID 396 | 72 397 | 398 | NS.objects 399 | 400 | 401 | CF$UID 402 | 46 403 | 404 | 405 | CF$UID 406 | 53 407 | 408 | 409 | CF$UID 410 | 57 411 | 412 | 413 | CF$UID 414 | 62 415 | 416 | 417 | 418 | 419 | $class 420 | 421 | CF$UID 422 | 31 423 | 424 | NS.keys 425 | 426 | 427 | CF$UID 428 | 47 429 | 430 | 431 | CF$UID 432 | 48 433 | 434 | 435 | CF$UID 436 | 49 437 | 438 | 439 | NS.objects 440 | 441 | 442 | CF$UID 443 | 50 444 | 445 | 446 | CF$UID 447 | 51 448 | 449 | 450 | CF$UID 451 | 52 452 | 453 | 454 | 455 | IDEActivityReportStringSegmentPriority 456 | IDEActivityReportStringSegmentBackSeparator 457 | IDEActivityReportStringSegmentStringValue 458 | 2 459 | 460 | Build 461 | 462 | $class 463 | 464 | CF$UID 465 | 31 466 | 467 | NS.keys 468 | 469 | 470 | CF$UID 471 | 47 472 | 473 | 474 | CF$UID 475 | 48 476 | 477 | 478 | CF$UID 479 | 49 480 | 481 | 482 | NS.objects 483 | 484 | 485 | CF$UID 486 | 54 487 | 488 | 489 | CF$UID 490 | 55 491 | 492 | 493 | CF$UID 494 | 56 495 | 496 | 497 | 498 | 4 499 | : 500 | serialCommunication 501 | 502 | $class 503 | 504 | CF$UID 505 | 31 506 | 507 | NS.keys 508 | 509 | 510 | CF$UID 511 | 47 512 | 513 | 514 | CF$UID 515 | 48 516 | 517 | 518 | CF$UID 519 | 49 520 | 521 | 522 | NS.objects 523 | 524 | 525 | CF$UID 526 | 58 527 | 528 | 529 | CF$UID 530 | 59 531 | 532 | 533 | CF$UID 534 | 60 535 | 536 | 537 | 538 | 1 539 | 540 | 541 | $class 542 | 543 | CF$UID 544 | 61 545 | 546 | NS.data 547 | 548 | YnBsaXN0MDDUAQIDBAUGOzxYJHZlcnNpb25YJG9iamVjdHNZJGFy 549 | Y2hpdmVyVCR0b3ASAAGGoK0HCA8QGhscJCUrMTQ3VSRudWxs0wkK 550 | CwwNDlxOU0F0dHJpYnV0ZXNWJGNsYXNzWE5TU3RyaW5ngAOADIAC 551 | WVN1Y2NlZWRlZNMKERITFBdXTlMua2V5c1pOUy5vYmplY3RzgAui 552 | FRaABIAFohgZgAaACVZOU0ZvbnRXTlNDb2xvctQKHR4fICEiI1ZO 553 | U05hbWVWTlNTaXplWE5TZkZsYWdzgAiAByNAJgAAAAAAABENEF8Q 554 | EUx1Y2lkYUdyYW5kZS1Cb2xk0iYnKClaJGNsYXNzbmFtZVgkY2xh 555 | c3Nlc1ZOU0ZvbnSiKCpYTlNPYmplY3TTCiwtLi8wXE5TQ29sb3JT 556 | cGFjZVdOU1doaXRlgAoQA0IwANImJzIzV05TQ29sb3KiMirSJic1 557 | NlxOU0RpY3Rpb25hcnmiNSrSJic4OV8QEk5TQXR0cmlidXRlZFN0 558 | cmluZ6I6Kl8QEk5TQXR0cmlidXRlZFN0cmluZ18QD05TS2V5ZWRB 559 | cmNoaXZlctE9PlRyb290gAEACAARABoAIwAtADIANwBFAEsAUgBf 560 | AGYAbwBxAHMAdQB/AIYAjgCZAJsAngCgAKIApQCnAKkAsAC4AMEA 561 | yADPANgA2gDcAOUA6AD8AQEBDAEVARwBHwEoAS8BPAFEAUYBSAFL 562 | AVABWAFbAWABbQFwAXUBigGNAaIBtAG3AbwAAAAAAAACAQAAAAAA 563 | AAA/AAAAAAAAAAAAAAAAAAABvg== 564 | 565 | 566 | 567 | $classes 568 | 569 | NSMutableData 570 | NSData 571 | NSObject 572 | 573 | $classname 574 | NSMutableData 575 | 576 | 577 | $class 578 | 579 | CF$UID 580 | 31 581 | 582 | NS.keys 583 | 584 | 585 | CF$UID 586 | 47 587 | 588 | 589 | CF$UID 590 | 63 591 | 592 | 593 | CF$UID 594 | 64 595 | 596 | 597 | CF$UID 598 | 49 599 | 600 | 601 | CF$UID 602 | 65 603 | 604 | 605 | CF$UID 606 | 66 607 | 608 | 609 | NS.objects 610 | 611 | 612 | CF$UID 613 | 67 614 | 615 | 616 | CF$UID 617 | 68 618 | 619 | 620 | CF$UID 621 | 69 622 | 623 | 624 | CF$UID 625 | 71 626 | 627 | 628 | CF$UID 629 | 68 630 | 631 | 632 | CF$UID 633 | 68 634 | 635 | 636 | 637 | IDEActivityReportStringSegmentType 638 | IDEActivityReportStringSegmentDate 639 | IDEActivityReportStringSegmentDateStyle 640 | IDEActivityReportStringSegmentTimeStyle 641 | 3 642 | 1 643 | 644 | $class 645 | 646 | CF$UID 647 | 70 648 | 649 | NS.time 650 | 331613018.73067701 651 | 652 | 653 | $classes 654 | 655 | NSDate 656 | NSObject 657 | 658 | $classname 659 | NSDate 660 | 661 | Today at 11:43 AM 662 | 663 | $classes 664 | 665 | NSMutableArray 666 | NSArray 667 | NSObject 668 | 669 | $classname 670 | NSMutableArray 671 | 672 | 106 673 | serialCommunication 674 | 675 | $class 676 | 677 | CF$UID 678 | 72 679 | 680 | NS.objects 681 | 682 | 683 | CF$UID 684 | 3 685 | 686 | 687 | 688 | 689 | $class 690 | 691 | CF$UID 692 | 72 693 | 694 | NS.objects 695 | 696 | 697 | CF$UID 698 | 77 699 | 700 | 701 | 702 | 703 | $class 704 | 705 | CF$UID 706 | 22 707 | 708 | NS.base 709 | 710 | CF$UID 711 | 0 712 | 713 | NS.relative 714 | 715 | CF$UID 716 | 78 717 | 718 | 719 | file://localhost/Users/yusukesekikawa/Dropbox/Dev/SerialCommunicationFramework/Classes/SerialCommunication.m 720 | 721 | $class 722 | 723 | CF$UID 724 | 31 725 | 726 | NS.keys 727 | 728 | 729 | CF$UID 730 | 80 731 | 732 | 733 | CF$UID 734 | 81 735 | 736 | 737 | CF$UID 738 | 82 739 | 740 | 741 | CF$UID 742 | 83 743 | 744 | 745 | CF$UID 746 | 84 747 | 748 | 749 | CF$UID 750 | 85 751 | 752 | 753 | NS.objects 754 | 755 | 756 | CF$UID 757 | 86 758 | 759 | 760 | CF$UID 761 | 254 762 | 763 | 764 | CF$UID 765 | 95 766 | 767 | 768 | CF$UID 769 | 80 770 | 771 | 772 | CF$UID 773 | 255 774 | 775 | 776 | CF$UID 777 | 3 778 | 779 | 780 | 781 | IDEWorkspaceTabController_9B77B469-D416-46EC-B009-AC6764A9AF89 782 | IDEOrderedWorkspaceTabControllers 783 | IDEWindowToolbarIsVisible 784 | IDEActiveWorkspaceTabController 785 | IDEWindowFrame 786 | IDEWorkspaceWindowControllerUniqueIdentifier 787 | 788 | $class 789 | 790 | CF$UID 791 | 31 792 | 793 | NS.keys 794 | 795 | 796 | CF$UID 797 | 87 798 | 799 | 800 | CF$UID 801 | 88 802 | 803 | 804 | CF$UID 805 | 89 806 | 807 | 808 | CF$UID 809 | 90 810 | 811 | 812 | CF$UID 813 | 91 814 | 815 | 816 | CF$UID 817 | 92 818 | 819 | 820 | CF$UID 821 | 93 822 | 823 | 824 | CF$UID 825 | 94 826 | 827 | 828 | NS.objects 829 | 830 | 831 | CF$UID 832 | 32 833 | 834 | 835 | CF$UID 836 | 95 837 | 838 | 839 | CF$UID 840 | 96 841 | 842 | 843 | CF$UID 844 | 97 845 | 846 | 847 | CF$UID 848 | 108 849 | 850 | 851 | CF$UID 852 | 150 853 | 854 | 855 | CF$UID 856 | 15 857 | 858 | 859 | CF$UID 860 | 159 861 | 862 | 863 | 864 | AssistantEditorsLayout 865 | IDEShowNavigator 866 | IDETabLabel 867 | IDEWorkspaceTabControllerUtilityAreaSplitView 868 | IDENavigatorArea 869 | IDEWorkspaceTabControllerDesignAreaSplitView 870 | IDEShowUtilities 871 | IDEEditorArea 872 | 873 | SerialCommunication.m 874 | 875 | $class 876 | 877 | CF$UID 878 | 31 879 | 880 | NS.keys 881 | 882 | 883 | CF$UID 884 | 98 885 | 886 | 887 | NS.objects 888 | 889 | 890 | CF$UID 891 | 99 892 | 893 | 894 | 895 | DVTSplitViewItems 896 | 897 | $class 898 | 899 | CF$UID 900 | 72 901 | 902 | NS.objects 903 | 904 | 905 | CF$UID 906 | 100 907 | 908 | 909 | CF$UID 910 | 106 911 | 912 | 913 | 914 | 915 | $class 916 | 917 | CF$UID 918 | 105 919 | 920 | NS.keys 921 | 922 | 923 | CF$UID 924 | 101 925 | 926 | 927 | CF$UID 928 | 102 929 | 930 | 931 | NS.objects 932 | 933 | 934 | CF$UID 935 | 103 936 | 937 | 938 | CF$UID 939 | 104 940 | 941 | 942 | 943 | DVTIdentifier 944 | DVTViewMagnitude 945 | 946 | 446 947 | 948 | $classes 949 | 950 | NSDictionary 951 | NSObject 952 | 953 | $classname 954 | NSDictionary 955 | 956 | 957 | $class 958 | 959 | CF$UID 960 | 105 961 | 962 | NS.keys 963 | 964 | 965 | CF$UID 966 | 101 967 | 968 | 969 | CF$UID 970 | 102 971 | 972 | 973 | NS.objects 974 | 975 | 976 | CF$UID 977 | 103 978 | 979 | 980 | CF$UID 981 | 107 982 | 983 | 984 | 985 | 224 986 | 987 | $class 988 | 989 | CF$UID 990 | 31 991 | 992 | NS.keys 993 | 994 | 995 | CF$UID 996 | 109 997 | 998 | 999 | CF$UID 1000 | 110 1001 | 1002 | 1003 | CF$UID 1004 | 111 1005 | 1006 | 1007 | NS.objects 1008 | 1009 | 1010 | CF$UID 1011 | 112 1012 | 1013 | 1014 | CF$UID 1015 | 109 1016 | 1017 | 1018 | CF$UID 1019 | 130 1020 | 1021 | 1022 | 1023 | Xcode.IDEKit.Navigator.Issues 1024 | SelectedNavigator 1025 | Xcode.IDEKit.Navigator.Structure 1026 | 1027 | $class 1028 | 1029 | CF$UID 1030 | 31 1031 | 1032 | NS.keys 1033 | 1034 | 1035 | CF$UID 1036 | 113 1037 | 1038 | 1039 | CF$UID 1040 | 114 1041 | 1042 | 1043 | CF$UID 1044 | 115 1045 | 1046 | 1047 | CF$UID 1048 | 116 1049 | 1050 | 1051 | CF$UID 1052 | 117 1053 | 1054 | 1055 | CF$UID 1056 | 118 1057 | 1058 | 1059 | CF$UID 1060 | 119 1061 | 1062 | 1063 | CF$UID 1064 | 120 1065 | 1066 | 1067 | CF$UID 1068 | 121 1069 | 1070 | 1071 | CF$UID 1072 | 122 1073 | 1074 | 1075 | NS.objects 1076 | 1077 | 1078 | CF$UID 1079 | 15 1080 | 1081 | 1082 | CF$UID 1083 | 123 1084 | 1085 | 1086 | CF$UID 1087 | 124 1088 | 1089 | 1090 | CF$UID 1091 | 126 1092 | 1093 | 1094 | CF$UID 1095 | 127 1096 | 1097 | 1098 | CF$UID 1099 | 15 1100 | 1101 | 1102 | CF$UID 1103 | 15 1104 | 1105 | 1106 | CF$UID 1107 | 128 1108 | 1109 | 1110 | CF$UID 1111 | 15 1112 | 1113 | 1114 | CF$UID 1115 | 129 1116 | 1117 | 1118 | 1119 | IDEErrorFilteringEnabled 1120 | IDEVisibleRect 1121 | IDECollapsedFiles 1122 | IDEExpandedIssues 1123 | IDESelectedNavigables 1124 | IDEShowsByType 1125 | IDESchemeFilteringEnabled 1126 | IDECollapsedTypes 1127 | IDERecentFilteringEnabled 1128 | IDECollapsedGroups 1129 | {{0, 0}, {259, 604}} 1130 | 1131 | $class 1132 | 1133 | CF$UID 1134 | 125 1135 | 1136 | NS.objects 1137 | 1138 | 1139 | 1140 | $classes 1141 | 1142 | NSMutableSet 1143 | NSSet 1144 | NSObject 1145 | 1146 | $classname 1147 | NSMutableSet 1148 | 1149 | 1150 | $class 1151 | 1152 | CF$UID 1153 | 125 1154 | 1155 | NS.objects 1156 | 1157 | 1158 | 1159 | $class 1160 | 1161 | CF$UID 1162 | 72 1163 | 1164 | NS.objects 1165 | 1166 | 1167 | 1168 | $class 1169 | 1170 | CF$UID 1171 | 125 1172 | 1173 | NS.objects 1174 | 1175 | 1176 | 1177 | $class 1178 | 1179 | CF$UID 1180 | 125 1181 | 1182 | NS.objects 1183 | 1184 | 1185 | 1186 | $class 1187 | 1188 | CF$UID 1189 | 31 1190 | 1191 | NS.keys 1192 | 1193 | 1194 | CF$UID 1195 | 131 1196 | 1197 | 1198 | CF$UID 1199 | 132 1200 | 1201 | 1202 | CF$UID 1203 | 133 1204 | 1205 | 1206 | CF$UID 1207 | 134 1208 | 1209 | 1210 | CF$UID 1211 | 135 1212 | 1213 | 1214 | CF$UID 1215 | 136 1216 | 1217 | 1218 | CF$UID 1219 | 137 1220 | 1221 | 1222 | NS.objects 1223 | 1224 | 1225 | CF$UID 1226 | 138 1227 | 1228 | 1229 | CF$UID 1230 | 15 1231 | 1232 | 1233 | CF$UID 1234 | 139 1235 | 1236 | 1237 | CF$UID 1238 | 15 1239 | 1240 | 1241 | CF$UID 1242 | 15 1243 | 1244 | 1245 | CF$UID 1246 | 141 1247 | 1248 | 1249 | CF$UID 1250 | 147 1251 | 1252 | 1253 | 1254 | IDEVisibleRect 1255 | IDEUnsavedDocumentFilteringEnabled 1256 | IDENavigatorExpandedItemsBeforeFilteringSet 1257 | IDERecentDocumentFilteringEnabled 1258 | IDESCMStatusFilteringEnabled 1259 | IDESelectedObjects 1260 | IDEExpandedItemsSet 1261 | {{0, 0}, {259, 626}} 1262 | 1263 | $class 1264 | 1265 | CF$UID 1266 | 140 1267 | 1268 | NS.objects 1269 | 1270 | 1271 | 1272 | $classes 1273 | 1274 | NSSet 1275 | NSObject 1276 | 1277 | $classname 1278 | NSSet 1279 | 1280 | 1281 | $class 1282 | 1283 | CF$UID 1284 | 146 1285 | 1286 | NS.objects 1287 | 1288 | 1289 | CF$UID 1290 | 142 1291 | 1292 | 1293 | 1294 | 1295 | $class 1296 | 1297 | CF$UID 1298 | 72 1299 | 1300 | NS.objects 1301 | 1302 | 1303 | CF$UID 1304 | 143 1305 | 1306 | 1307 | CF$UID 1308 | 144 1309 | 1310 | 1311 | CF$UID 1312 | 145 1313 | 1314 | 1315 | 1316 | serialCommunication 1317 | classes 1318 | SerialCommunication.m 1319 | 1320 | $classes 1321 | 1322 | NSArray 1323 | NSObject 1324 | 1325 | $classname 1326 | NSArray 1327 | 1328 | 1329 | $class 1330 | 1331 | CF$UID 1332 | 140 1333 | 1334 | NS.objects 1335 | 1336 | 1337 | CF$UID 1338 | 148 1339 | 1340 | 1341 | CF$UID 1342 | 149 1343 | 1344 | 1345 | 1346 | 1347 | $class 1348 | 1349 | CF$UID 1350 | 72 1351 | 1352 | NS.objects 1353 | 1354 | 1355 | CF$UID 1356 | 143 1357 | 1358 | 1359 | 1360 | 1361 | $class 1362 | 1363 | CF$UID 1364 | 72 1365 | 1366 | NS.objects 1367 | 1368 | 1369 | CF$UID 1370 | 143 1371 | 1372 | 1373 | CF$UID 1374 | 144 1375 | 1376 | 1377 | 1378 | 1379 | $class 1380 | 1381 | CF$UID 1382 | 31 1383 | 1384 | NS.keys 1385 | 1386 | 1387 | CF$UID 1388 | 98 1389 | 1390 | 1391 | NS.objects 1392 | 1393 | 1394 | CF$UID 1395 | 151 1396 | 1397 | 1398 | 1399 | 1400 | $class 1401 | 1402 | CF$UID 1403 | 72 1404 | 1405 | NS.objects 1406 | 1407 | 1408 | CF$UID 1409 | 152 1410 | 1411 | 1412 | CF$UID 1413 | 154 1414 | 1415 | 1416 | CF$UID 1417 | 156 1418 | 1419 | 1420 | 1421 | 1422 | $class 1423 | 1424 | CF$UID 1425 | 105 1426 | 1427 | NS.keys 1428 | 1429 | 1430 | CF$UID 1431 | 101 1432 | 1433 | 1434 | CF$UID 1435 | 102 1436 | 1437 | 1438 | NS.objects 1439 | 1440 | 1441 | CF$UID 1442 | 91 1443 | 1444 | 1445 | CF$UID 1446 | 153 1447 | 1448 | 1449 | 1450 | 260 1451 | 1452 | $class 1453 | 1454 | CF$UID 1455 | 105 1456 | 1457 | NS.keys 1458 | 1459 | 1460 | CF$UID 1461 | 101 1462 | 1463 | 1464 | CF$UID 1465 | 102 1466 | 1467 | 1468 | NS.objects 1469 | 1470 | 1471 | CF$UID 1472 | 94 1473 | 1474 | 1475 | CF$UID 1476 | 155 1477 | 1478 | 1479 | 1480 | 1062 1481 | 1482 | $class 1483 | 1484 | CF$UID 1485 | 105 1486 | 1487 | NS.keys 1488 | 1489 | 1490 | CF$UID 1491 | 101 1492 | 1493 | 1494 | CF$UID 1495 | 102 1496 | 1497 | 1498 | NS.objects 1499 | 1500 | 1501 | CF$UID 1502 | 157 1503 | 1504 | 1505 | CF$UID 1506 | 158 1507 | 1508 | 1509 | 1510 | IDEUtilitiesArea 1511 | 260 1512 | 1513 | $class 1514 | 1515 | CF$UID 1516 | 31 1517 | 1518 | NS.keys 1519 | 1520 | 1521 | CF$UID 1522 | 160 1523 | 1524 | 1525 | CF$UID 1526 | 161 1527 | 1528 | 1529 | CF$UID 1530 | 162 1531 | 1532 | 1533 | CF$UID 1534 | 163 1535 | 1536 | 1537 | CF$UID 1538 | 164 1539 | 1540 | 1541 | CF$UID 1542 | 165 1543 | 1544 | 1545 | CF$UID 1546 | 166 1547 | 1548 | 1549 | CF$UID 1550 | 167 1551 | 1552 | 1553 | NS.objects 1554 | 1555 | 1556 | CF$UID 1557 | 168 1558 | 1559 | 1560 | CF$UID 1561 | 186 1562 | 1563 | 1564 | CF$UID 1565 | 219 1566 | 1567 | 1568 | CF$UID 1569 | 95 1570 | 1571 | 1572 | CF$UID 1573 | 32 1574 | 1575 | 1576 | CF$UID 1577 | 245 1578 | 1579 | 1580 | CF$UID 1581 | 253 1582 | 1583 | 1584 | CF$UID 1585 | 15 1586 | 1587 | 1588 | 1589 | layoutTree 1590 | IDEEditorMode_Standard 1591 | IDEEDitorArea_DebugArea 1592 | IDEShowEditor 1593 | EditorMode 1594 | DebuggerSplitView 1595 | DefaultPersistentRepresentations 1596 | ShowDebuggerArea 1597 | 1598 | $class 1599 | 1600 | CF$UID 1601 | 185 1602 | 1603 | geniusEditorContextNode 1604 | 1605 | CF$UID 1606 | 0 1607 | 1608 | primaryEditorContextNode 1609 | 1610 | CF$UID 1611 | 169 1612 | 1613 | rootLayoutTreeNode 1614 | 1615 | CF$UID 1616 | 182 1617 | 1618 | 1619 | 1620 | $class 1621 | 1622 | CF$UID 1623 | 184 1624 | 1625 | children 1626 | 1627 | CF$UID 1628 | 0 1629 | 1630 | contentType 1631 | 1 1632 | documentArchivableRepresentation 1633 | 1634 | CF$UID 1635 | 170 1636 | 1637 | orientation 1638 | 0 1639 | parent 1640 | 1641 | CF$UID 1642 | 182 1643 | 1644 | 1645 | 1646 | $class 1647 | 1648 | CF$UID 1649 | 181 1650 | 1651 | DocumentLocation 1652 | 1653 | CF$UID 1654 | 178 1655 | 1656 | DomainIdentifier 1657 | 1658 | CF$UID 1659 | 171 1660 | 1661 | IdentifierPath 1662 | 1663 | CF$UID 1664 | 172 1665 | 1666 | IndexOfDocumentIdentifier 1667 | 1668 | CF$UID 1669 | 32 1670 | 1671 | 1672 | Xcode.IDENavigableItemDomain.WorkspaceStructure 1673 | 1674 | $class 1675 | 1676 | CF$UID 1677 | 146 1678 | 1679 | NS.objects 1680 | 1681 | 1682 | CF$UID 1683 | 173 1684 | 1685 | 1686 | CF$UID 1687 | 175 1688 | 1689 | 1690 | CF$UID 1691 | 176 1692 | 1693 | 1694 | 1695 | 1696 | $class 1697 | 1698 | CF$UID 1699 | 174 1700 | 1701 | Identifier 1702 | 1703 | CF$UID 1704 | 145 1705 | 1706 | 1707 | 1708 | $classes 1709 | 1710 | IDEArchivableStringIndexPair 1711 | NSObject 1712 | 1713 | $classname 1714 | IDEArchivableStringIndexPair 1715 | 1716 | 1717 | $class 1718 | 1719 | CF$UID 1720 | 174 1721 | 1722 | Identifier 1723 | 1724 | CF$UID 1725 | 144 1726 | 1727 | 1728 | 1729 | $class 1730 | 1731 | CF$UID 1732 | 174 1733 | 1734 | Identifier 1735 | 1736 | CF$UID 1737 | 177 1738 | 1739 | 1740 | serialCommunication 1741 | 1742 | $class 1743 | 1744 | CF$UID 1745 | 180 1746 | 1747 | documentURL 1748 | 1749 | CF$UID 1750 | 179 1751 | 1752 | timestamp 1753 | 1754 | CF$UID 1755 | 0 1756 | 1757 | 1758 | 1759 | $class 1760 | 1761 | CF$UID 1762 | 21 1763 | 1764 | NS.string 1765 | file://localhost/Users/yusukesekikawa/Dropbox/Dev/SerialCommunicationFramework/Classes/SerialCommunication.m 1766 | 1767 | 1768 | $classes 1769 | 1770 | DVTDocumentLocation 1771 | NSObject 1772 | 1773 | $classname 1774 | DVTDocumentLocation 1775 | 1776 | 1777 | $classes 1778 | 1779 | IDENavigableItemArchivableRepresentation 1780 | NSObject 1781 | 1782 | $classname 1783 | IDENavigableItemArchivableRepresentation 1784 | 1785 | 1786 | $class 1787 | 1788 | CF$UID 1789 | 184 1790 | 1791 | children 1792 | 1793 | CF$UID 1794 | 183 1795 | 1796 | contentType 1797 | 0 1798 | documentArchivableRepresentation 1799 | 1800 | CF$UID 1801 | 0 1802 | 1803 | orientation 1804 | 0 1805 | parent 1806 | 1807 | CF$UID 1808 | 0 1809 | 1810 | 1811 | 1812 | $class 1813 | 1814 | CF$UID 1815 | 146 1816 | 1817 | NS.objects 1818 | 1819 | 1820 | CF$UID 1821 | 169 1822 | 1823 | 1824 | 1825 | 1826 | $classes 1827 | 1828 | IDEWorkspaceTabControllerLayoutTreeNode 1829 | NSObject 1830 | 1831 | $classname 1832 | IDEWorkspaceTabControllerLayoutTreeNode 1833 | 1834 | 1835 | $classes 1836 | 1837 | IDEWorkspaceTabControllerLayoutTree 1838 | NSObject 1839 | 1840 | $classname 1841 | IDEWorkspaceTabControllerLayoutTree 1842 | 1843 | 1844 | $class 1845 | 1846 | CF$UID 1847 | 31 1848 | 1849 | NS.keys 1850 | 1851 | 1852 | CF$UID 1853 | 187 1854 | 1855 | 1856 | NS.objects 1857 | 1858 | 1859 | CF$UID 1860 | 188 1861 | 1862 | 1863 | 1864 | EditorLayout_PersistentRepresentation 1865 | 1866 | $class 1867 | 1868 | CF$UID 1869 | 31 1870 | 1871 | NS.keys 1872 | 1873 | 1874 | CF$UID 1875 | 189 1876 | 1877 | 1878 | NS.objects 1879 | 1880 | 1881 | CF$UID 1882 | 190 1883 | 1884 | 1885 | 1886 | Main 1887 | 1888 | $class 1889 | 1890 | CF$UID 1891 | 105 1892 | 1893 | NS.keys 1894 | 1895 | 1896 | CF$UID 1897 | 191 1898 | 1899 | 1900 | CF$UID 1901 | 192 1902 | 1903 | 1904 | CF$UID 1905 | 193 1906 | 1907 | 1908 | NS.objects 1909 | 1910 | 1911 | CF$UID 1912 | 194 1913 | 1914 | 1915 | CF$UID 1916 | 32 1917 | 1918 | 1919 | CF$UID 1920 | 217 1921 | 1922 | 1923 | 1924 | EditorLayout_StateSavingStateDictionaries 1925 | EditorLayout_Selected 1926 | EditorLayout_Geometry 1927 | 1928 | $class 1929 | 1930 | CF$UID 1931 | 146 1932 | 1933 | NS.objects 1934 | 1935 | 1936 | CF$UID 1937 | 195 1938 | 1939 | 1940 | 1941 | 1942 | $class 1943 | 1944 | CF$UID 1945 | 31 1946 | 1947 | NS.keys 1948 | 1949 | 1950 | CF$UID 1951 | 196 1952 | 1953 | 1954 | CF$UID 1955 | 197 1956 | 1957 | 1958 | CF$UID 1959 | 198 1960 | 1961 | 1962 | CF$UID 1963 | 199 1964 | 1965 | 1966 | CF$UID 1967 | 200 1968 | 1969 | 1970 | CF$UID 1971 | 201 1972 | 1973 | 1974 | CF$UID 1975 | 202 1976 | 1977 | 1978 | NS.objects 1979 | 1980 | 1981 | CF$UID 1982 | 203 1983 | 1984 | 1985 | CF$UID 1986 | 204 1987 | 1988 | 1989 | CF$UID 1990 | 210 1991 | 1992 | 1993 | CF$UID 1994 | 214 1995 | 1996 | 1997 | CF$UID 1998 | 145 1999 | 2000 | 2001 | CF$UID 2002 | 17 2003 | 2004 | 2005 | CF$UID 2006 | 215 2007 | 2008 | 2009 | 2010 | FileDataType 2011 | ArchivableRepresentation 2012 | EditorState 2013 | NavigableItemName 2014 | DocumentNavigableItemName 2015 | DocumentExtensionIdentifier 2016 | DocumentURL 2017 | public.objective-c-source 2018 | 2019 | $class 2020 | 2021 | CF$UID 2022 | 181 2023 | 2024 | DocumentLocation 2025 | 2026 | CF$UID 2027 | 178 2028 | 2029 | DomainIdentifier 2030 | 2031 | CF$UID 2032 | 171 2033 | 2034 | IdentifierPath 2035 | 2036 | CF$UID 2037 | 205 2038 | 2039 | IndexOfDocumentIdentifier 2040 | 2041 | CF$UID 2042 | 32 2043 | 2044 | 2045 | 2046 | $class 2047 | 2048 | CF$UID 2049 | 146 2050 | 2051 | NS.objects 2052 | 2053 | 2054 | CF$UID 2055 | 206 2056 | 2057 | 2058 | CF$UID 2059 | 207 2060 | 2061 | 2062 | CF$UID 2063 | 208 2064 | 2065 | 2066 | 2067 | 2068 | $class 2069 | 2070 | CF$UID 2071 | 174 2072 | 2073 | Identifier 2074 | 2075 | CF$UID 2076 | 145 2077 | 2078 | 2079 | 2080 | $class 2081 | 2082 | CF$UID 2083 | 174 2084 | 2085 | Identifier 2086 | 2087 | CF$UID 2088 | 144 2089 | 2090 | 2091 | 2092 | $class 2093 | 2094 | CF$UID 2095 | 174 2096 | 2097 | Identifier 2098 | 2099 | CF$UID 2100 | 209 2101 | 2102 | 2103 | serialCommunication 2104 | 2105 | $class 2106 | 2107 | CF$UID 2108 | 105 2109 | 2110 | NS.keys 2111 | 2112 | 2113 | CF$UID 2114 | 24 2115 | 2116 | 2117 | CF$UID 2118 | 25 2119 | 2120 | 2121 | CF$UID 2122 | 26 2123 | 2124 | 2125 | CF$UID 2126 | 27 2127 | 2128 | 2129 | NS.objects 2130 | 2131 | 2132 | CF$UID 2133 | 211 2134 | 2135 | 2136 | CF$UID 2137 | 212 2138 | 2139 | 2140 | CF$UID 2141 | 15 2142 | 2143 | 2144 | CF$UID 2145 | 213 2146 | 2147 | 2148 | 2149 | 331614139.24024498 2150 | {2965, 999} 2151 | {3396, 0} 2152 | -sendSerialData: 2153 | 2154 | $class 2155 | 2156 | CF$UID 2157 | 22 2158 | 2159 | NS.base 2160 | 2161 | CF$UID 2162 | 0 2163 | 2164 | NS.relative 2165 | 2166 | CF$UID 2167 | 216 2168 | 2169 | 2170 | file://localhost/Users/yusukesekikawa/Dropbox/Dev/SerialCommunicationFramework/Classes/SerialCommunication.m 2171 | 2172 | $class 2173 | 2174 | CF$UID 2175 | 146 2176 | 2177 | NS.objects 2178 | 2179 | 2180 | CF$UID 2181 | 218 2182 | 2183 | 2184 | 2185 | {{0, 0}, {1062, 670}} 2186 | 2187 | $class 2188 | 2189 | CF$UID 2190 | 31 2191 | 2192 | NS.keys 2193 | 2194 | 2195 | CF$UID 2196 | 220 2197 | 2198 | 2199 | CF$UID 2200 | 221 2201 | 2202 | 2203 | CF$UID 2204 | 222 2205 | 2206 | 2207 | CF$UID 2208 | 223 2209 | 2210 | 2211 | CF$UID 2212 | 224 2213 | 2214 | 2215 | CF$UID 2216 | 225 2217 | 2218 | 2219 | NS.objects 2220 | 2221 | 2222 | CF$UID 2223 | 68 2224 | 2225 | 2226 | CF$UID 2227 | 226 2228 | 2229 | 2230 | CF$UID 2231 | 228 2232 | 2233 | 2234 | CF$UID 2235 | 68 2236 | 2237 | 2238 | CF$UID 2239 | 231 2240 | 2241 | 2242 | CF$UID 2243 | 239 2244 | 2245 | 2246 | 2247 | LayoutFocusMode 2248 | console 2249 | variables 2250 | LayoutMode 2251 | IDEDebugArea_SplitView 2252 | IDEDebuggerAreaSplitView 2253 | 2254 | $class 2255 | 2256 | CF$UID 2257 | 31 2258 | 2259 | NS.keys 2260 | 2261 | 2262 | CF$UID 2263 | 227 2264 | 2265 | 2266 | NS.objects 2267 | 2268 | 2269 | CF$UID 2270 | 32 2271 | 2272 | 2273 | 2274 | ConsoleFilterMode 2275 | 2276 | $class 2277 | 2278 | CF$UID 2279 | 31 2280 | 2281 | NS.keys 2282 | 2283 | 2284 | CF$UID 2285 | 229 2286 | 2287 | 2288 | NS.objects 2289 | 2290 | 2291 | CF$UID 2292 | 230 2293 | 2294 | 2295 | 2296 | DBGVariablesViewFilterMode 2297 | 2 2298 | 2299 | $class 2300 | 2301 | CF$UID 2302 | 31 2303 | 2304 | NS.keys 2305 | 2306 | 2307 | CF$UID 2308 | 98 2309 | 2310 | 2311 | NS.objects 2312 | 2313 | 2314 | CF$UID 2315 | 232 2316 | 2317 | 2318 | 2319 | 2320 | $class 2321 | 2322 | CF$UID 2323 | 72 2324 | 2325 | NS.objects 2326 | 2327 | 2328 | CF$UID 2329 | 233 2330 | 2331 | 2332 | CF$UID 2333 | 236 2334 | 2335 | 2336 | 2337 | 2338 | $class 2339 | 2340 | CF$UID 2341 | 105 2342 | 2343 | NS.keys 2344 | 2345 | 2346 | CF$UID 2347 | 101 2348 | 2349 | 2350 | CF$UID 2351 | 102 2352 | 2353 | 2354 | NS.objects 2355 | 2356 | 2357 | CF$UID 2358 | 234 2359 | 2360 | 2361 | CF$UID 2362 | 235 2363 | 2364 | 2365 | 2366 | VariablesView 2367 | 298 2368 | 2369 | $class 2370 | 2371 | CF$UID 2372 | 105 2373 | 2374 | NS.keys 2375 | 2376 | 2377 | CF$UID 2378 | 101 2379 | 2380 | 2381 | CF$UID 2382 | 102 2383 | 2384 | 2385 | NS.objects 2386 | 2387 | 2388 | CF$UID 2389 | 237 2390 | 2391 | 2392 | CF$UID 2393 | 238 2394 | 2395 | 2396 | 2397 | ConsoleArea 2398 | 763 2399 | 2400 | $class 2401 | 2402 | CF$UID 2403 | 31 2404 | 2405 | NS.keys 2406 | 2407 | 2408 | CF$UID 2409 | 98 2410 | 2411 | 2412 | NS.objects 2413 | 2414 | 2415 | CF$UID 2416 | 240 2417 | 2418 | 2419 | 2420 | 2421 | $class 2422 | 2423 | CF$UID 2424 | 72 2425 | 2426 | NS.objects 2427 | 2428 | 2429 | CF$UID 2430 | 241 2431 | 2432 | 2433 | CF$UID 2434 | 243 2435 | 2436 | 2437 | 2438 | 2439 | $class 2440 | 2441 | CF$UID 2442 | 105 2443 | 2444 | NS.keys 2445 | 2446 | 2447 | CF$UID 2448 | 101 2449 | 2450 | 2451 | CF$UID 2452 | 102 2453 | 2454 | 2455 | NS.objects 2456 | 2457 | 2458 | CF$UID 2459 | 234 2460 | 2461 | 2462 | CF$UID 2463 | 242 2464 | 2465 | 2466 | 2467 | 298 2468 | 2469 | $class 2470 | 2471 | CF$UID 2472 | 105 2473 | 2474 | NS.keys 2475 | 2476 | 2477 | CF$UID 2478 | 101 2479 | 2480 | 2481 | CF$UID 2482 | 102 2483 | 2484 | 2485 | NS.objects 2486 | 2487 | 2488 | CF$UID 2489 | 237 2490 | 2491 | 2492 | CF$UID 2493 | 244 2494 | 2495 | 2496 | 2497 | 763 2498 | 2499 | $class 2500 | 2501 | CF$UID 2502 | 31 2503 | 2504 | NS.keys 2505 | 2506 | 2507 | CF$UID 2508 | 98 2509 | 2510 | 2511 | NS.objects 2512 | 2513 | 2514 | CF$UID 2515 | 246 2516 | 2517 | 2518 | 2519 | 2520 | $class 2521 | 2522 | CF$UID 2523 | 72 2524 | 2525 | NS.objects 2526 | 2527 | 2528 | CF$UID 2529 | 247 2530 | 2531 | 2532 | CF$UID 2533 | 250 2534 | 2535 | 2536 | 2537 | 2538 | $class 2539 | 2540 | CF$UID 2541 | 105 2542 | 2543 | NS.keys 2544 | 2545 | 2546 | CF$UID 2547 | 101 2548 | 2549 | 2550 | CF$UID 2551 | 102 2552 | 2553 | 2554 | NS.objects 2555 | 2556 | 2557 | CF$UID 2558 | 248 2559 | 2560 | 2561 | CF$UID 2562 | 249 2563 | 2564 | 2565 | 2566 | IDEEditor 2567 | 203 2568 | 2569 | $class 2570 | 2571 | CF$UID 2572 | 105 2573 | 2574 | NS.keys 2575 | 2576 | 2577 | CF$UID 2578 | 101 2579 | 2580 | 2581 | CF$UID 2582 | 102 2583 | 2584 | 2585 | NS.objects 2586 | 2587 | 2588 | CF$UID 2589 | 251 2590 | 2591 | 2592 | CF$UID 2593 | 252 2594 | 2595 | 2596 | 2597 | IDEDebuggerArea 2598 | 115 2599 | 2600 | $class 2601 | 2602 | CF$UID 2603 | 31 2604 | 2605 | NS.keys 2606 | 2607 | NS.objects 2608 | 2609 | 2610 | 2611 | $class 2612 | 2613 | CF$UID 2614 | 146 2615 | 2616 | NS.objects 2617 | 2618 | 2619 | CF$UID 2620 | 80 2621 | 2622 | 2623 | 2624 | {{44, 0}, {1322, 746}} 2625 | 2626 | $top 2627 | 2628 | State 2629 | 2630 | CF$UID 2631 | 1 2632 | 2633 | 2634 | $version 2635 | 100000 2636 | 2637 | 2638 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/xcuserdata/sekikawayusuke.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/xcuserdata/sekikawayusuke.xcuserdatad/xcschemes/Debug.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/xcuserdata/sekikawayusuke.xcuserdatad/xcschemes/serialInput.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 32 | 38 | 39 | 40 | 41 | 42 | 50 | 51 | 52 | 53 | 60 | 61 | 63 | 64 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/xcuserdata/sekikawayusuke.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Debug.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | serialInput.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | EB72C66113694CB30044490D 21 | 22 | primary 23 | 24 | 25 | EB72C66E13694CB30044490D 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/xcuserdata/yusukesekikawa.xcuserdatad/xcschemes/serialCommunication.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /serialCommunication.xcodeproj/xcuserdata/yusukesekikawa.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | serialCommunication.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | EB72C66113694CB30044490D 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | --------------------------------------------------------------------------------