Permalink
Browse files

Added Proximity Sensor Support

- Web applications can now request proximity sensor updates using CWProximity.startTracking(). This will cause "proximityStateChanged" events to be sent to the web application.
- Updated docs
  • Loading branch information...
BlackWolf committed Jun 14, 2015
1 parent bce13c3 commit c6f4fee152db3784b8a73c2b343fbe2346838dae
Showing with 8,250 additions and 6,893 deletions.
  1. +12 −0 Connichiwa.xcodeproj/project.pbxproj
  2. +1 −1 Connichiwa/CWBluetoothConnection.m
  3. +1 −1 Connichiwa/CWBluetoothManager.m
  4. +21 −0 Connichiwa/CWProximityManager.h
  5. +49 −0 Connichiwa/CWProximityManager.m
  6. +15 −0 Connichiwa/CWProximityManagerDelegate.h
  7. +9 −0 Connichiwa/CWRemoteLibraryManager.h
  8. +43 −0 Connichiwa/CWRemoteLibraryManager.m
  9. +22 −0 Connichiwa/CWRemoteLibraryManagerDelegate.h
  10. +45 −1 Connichiwa/CWWebApplication.m
  11. +2 −0 Connichiwa/CWWebLibraryManager.h
  12. +46 −0 Connichiwa/CWWebLibraryManager.m
  13. +4 −0 Connichiwa/CWWebLibraryManagerDelegate.h
  14. +1 −1 ConnichiwaDocs/native/docset-installed.txt
  15. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/BLWebSocketConnection.html
  16. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/BLWebSocketsServer.html
  17. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWBluetoothConnection.html
  18. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWBluetoothManager.html
  19. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWBluetoothTransferCentralKey.html
  20. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWBluetoothTransferManager.html
  21. +1 −1 ...hiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWBluetoothTransferPeripheralKey.html
  22. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWBundle.html
  23. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWDebug.html
  24. +132 −2 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWRemoteLibraryManager.html
  25. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWServerManager.html
  26. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWUtil.html
  27. +148 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWWebApplication.html
  28. +85 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWWebLibraryManager.html
  29. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/CWiDevice.html
  30. +71 −71 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServer.html
  31. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerBodyDecoder.html
  32. +1 −26 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerBodyEncoder.html
  33. +41 −41 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerConnection.html
  34. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerDataRequest.html
  35. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerDataResponse.html
  36. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerErrorResponse.html
  37. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerFileRequest.html
  38. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerFileResponse.html
  39. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerGZipDecoder.html
  40. +1 −26 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerGZipEncoder.html
  41. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerHandler.html
  42. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerMIMEStreamParser.html
  43. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerMultiPart.html
  44. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerMultiPartArgument.html
  45. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerMultiPartFile.html
  46. +1 −1 ...hiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerMultiPartFormRequest.html
  47. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerRequest.html
  48. +1 −26 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerResponse.html
  49. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerStreamedResponse.html
  50. +1 −1 ...iwaDocs/native/docset/Contents/Resources/Documents/Classes/GCDWebServerURLEncodedFormRequest.html
  51. +1 −1 ...aDocs/native/docset/Contents/Resources/Documents/Constants/CWBluetoothConnectionIPWriteState.html
  52. +1 −1 ...s/native/docset/Contents/Resources/Documents/Constants/CWBluetoothConnectionInitialDataState.html
  53. +1 −1 ...ichiwaDocs/native/docset/Contents/Resources/Documents/Constants/CWBluetoothConnectionMCState.html
  54. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Constants/CWRemoteLibraryManagerState.html
  55. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Constants/CWServerManagerState.html
  56. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Constants/CWWebLibraryManagerState.html
  57. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Constants/CWiDeviceModel.html
  58. +1 −1 ...s/native/docset/Contents/Resources/Documents/Constants/GCDWebServerClientErrorHTTPStatusCode.html
  59. +1 −1 ...native/docset/Contents/Resources/Documents/Constants/GCDWebServerInformationalHTTPStatusCode.html
  60. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Constants/GCDWebServerLoggingLevel.html
  61. +1 −1 ...s/native/docset/Contents/Resources/Documents/Constants/GCDWebServerRedirectionHTTPStatusCode.html
  62. +1 −1 ...s/native/docset/Contents/Resources/Documents/Constants/GCDWebServerServerErrorHTTPStatusCode.html
  63. +1 −1 ...cs/native/docset/Contents/Resources/Documents/Constants/GCDWebServerSuccessfulHTTPStatusCode.html
  64. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Protocols/CWBluetoothManagerDelegate.html
  65. +1 −1 ...Docs/native/docset/Contents/Resources/Documents/Protocols/CWBluetoothTransferManagerDelegate.html
  66. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Protocols/CWServerManagerDelegate.html
  67. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Protocols/CWWebApplicationState.html
  68. +43 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Protocols/CWWebLibraryManagerDelegate.html
  69. +1 −26 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Protocols/GCDWebServerBodyReader.html
  70. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Protocols/GCDWebServerBodyWriter.html
  71. +1 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/Protocols/GCDWebServerDelegate.html
  72. +7 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/hierarchy.html
  73. +7 −1 ConnichiwaDocs/native/docset/Contents/Resources/Documents/index.html
  74. +141 −51 ConnichiwaDocs/native/docset/Contents/Resources/Nodes.xml
  75. +39 −264 ConnichiwaDocs/native/docset/Contents/Resources/Tokens10.xml
  76. +183 −165 ConnichiwaDocs/native/docset/Contents/Resources/Tokens11.xml
  77. +350 −38 ConnichiwaDocs/native/docset/Contents/Resources/Tokens12.xml
  78. +34 −814 ConnichiwaDocs/native/docset/Contents/Resources/Tokens13.xml
  79. +655 −254 ConnichiwaDocs/native/docset/Contents/Resources/Tokens14.xml
  80. +554 −28 ConnichiwaDocs/native/docset/Contents/Resources/Tokens15.xml
  81. +28 −981 ConnichiwaDocs/native/docset/Contents/Resources/Tokens16.xml
  82. +997 −20 ConnichiwaDocs/native/docset/Contents/Resources/Tokens17.xml
  83. +20 −20 ConnichiwaDocs/native/docset/Contents/Resources/Tokens18.xml
  84. +18 −584 ConnichiwaDocs/native/docset/Contents/Resources/Tokens19.xml
  85. +523 −72 ConnichiwaDocs/native/docset/Contents/Resources/Tokens20.xml
  86. +75 −86 ConnichiwaDocs/native/docset/Contents/Resources/Tokens21.xml
  87. +115 −54 ConnichiwaDocs/native/docset/Contents/Resources/Tokens22.xml
  88. +53 −49 ConnichiwaDocs/native/docset/Contents/Resources/Tokens23.xml
  89. +40 −99 ConnichiwaDocs/native/docset/Contents/Resources/Tokens24.xml
  90. +146 −14 ConnichiwaDocs/native/docset/Contents/Resources/Tokens25.xml
  91. +15 −27 ConnichiwaDocs/native/docset/Contents/Resources/Tokens26.xml
  92. +19 −55 ConnichiwaDocs/native/docset/Contents/Resources/Tokens27.xml
  93. +39 −27 ConnichiwaDocs/native/docset/Contents/Resources/Tokens28.xml
  94. +32 −84 ConnichiwaDocs/native/docset/Contents/Resources/Tokens29.xml
  95. +63 −39 ConnichiwaDocs/native/docset/Contents/Resources/Tokens30.xml
  96. +35 −44 ConnichiwaDocs/native/docset/Contents/Resources/Tokens31.xml
  97. +35 −102 ConnichiwaDocs/native/docset/Contents/Resources/Tokens32.xml
  98. +67 −497 ConnichiwaDocs/native/docset/Contents/Resources/Tokens33.xml
  99. +289 −230 ConnichiwaDocs/native/docset/Contents/Resources/Tokens34.xml
  100. +504 −30 ConnichiwaDocs/native/docset/Contents/Resources/Tokens35.xml
  101. +31 −33 ConnichiwaDocs/native/docset/Contents/Resources/Tokens36.xml
  102. +52 −97 ConnichiwaDocs/native/docset/Contents/Resources/Tokens37.xml
  103. +110 −14 ConnichiwaDocs/native/docset/Contents/Resources/Tokens38.xml
  104. +15 −20 ConnichiwaDocs/native/docset/Contents/Resources/Tokens39.xml
  105. +8 −248 ConnichiwaDocs/native/docset/Contents/Resources/Tokens40.xml
  106. +14 −36 ConnichiwaDocs/native/docset/Contents/Resources/Tokens41.xml
  107. +22 −42 ConnichiwaDocs/native/docset/Contents/Resources/Tokens42.xml
  108. +232 −17 ConnichiwaDocs/native/docset/Contents/Resources/Tokens43.xml
  109. +45 −38 ConnichiwaDocs/native/docset/Contents/Resources/Tokens44.xml
  110. +49 −40 ConnichiwaDocs/native/docset/Contents/Resources/Tokens45.xml
  111. +38 −41 ConnichiwaDocs/native/docset/Contents/Resources/Tokens46.xml
  112. +64 −31 ConnichiwaDocs/native/docset/Contents/Resources/Tokens47.xml
  113. +20 −35 ConnichiwaDocs/native/docset/Contents/Resources/Tokens48.xml
  114. +20 −24 ConnichiwaDocs/native/docset/Contents/Resources/Tokens49.xml
  115. +16 −30 ConnichiwaDocs/native/docset/Contents/Resources/Tokens50.xml
  116. +29 −214 ConnichiwaDocs/native/docset/Contents/Resources/Tokens51.xml
  117. +24 −230 ConnichiwaDocs/native/docset/Contents/Resources/Tokens52.xml
  118. +30 −16 ConnichiwaDocs/native/docset/Contents/Resources/Tokens53.xml
  119. +202 −23 ConnichiwaDocs/native/docset/Contents/Resources/Tokens54.xml
  120. +189 −19 ConnichiwaDocs/native/docset/Contents/Resources/Tokens55.xml
  121. +9 −79 ConnichiwaDocs/native/docset/Contents/Resources/Tokens56.xml
  122. +23 −52 ConnichiwaDocs/native/docset/Contents/Resources/Tokens57.xml
  123. BIN ConnichiwaDocs/native/docset/Contents/Resources/docSet.dsidx
  124. BIN ConnichiwaDocs/native/docset/Contents/Resources/docSet.dsidx-shm
  125. BIN ConnichiwaDocs/native/docset/Contents/Resources/docSet.dsidx-wal
  126. BIN ConnichiwaDocs/native/docset/Contents/Resources/docSet.skidx
  127. BIN ConnichiwaDocs/native/docset/Contents/Resources/docSet.toc
  128. BIN ConnichiwaDocs/native/docset/Contents/Resources/docSet.tokencache
  129. +1 −1 ConnichiwaDocs/native/html/Classes/BLWebSocketConnection.html
  130. +1 −1 ConnichiwaDocs/native/html/Classes/BLWebSocketsServer.html
  131. +1 −1 ConnichiwaDocs/native/html/Classes/CWBluetoothConnection.html
  132. +1 −1 ConnichiwaDocs/native/html/Classes/CWBluetoothManager.html
  133. +1 −1 ConnichiwaDocs/native/html/Classes/CWBluetoothTransferCentralKey.html
  134. +1 −1 ConnichiwaDocs/native/html/Classes/CWBluetoothTransferManager.html
  135. +1 −1 ConnichiwaDocs/native/html/Classes/CWBluetoothTransferPeripheralKey.html
  136. +1 −1 ConnichiwaDocs/native/html/Classes/CWBundle.html
  137. +1 −1 ConnichiwaDocs/native/html/Classes/CWDebug.html
  138. +132 −2 ConnichiwaDocs/native/html/Classes/CWRemoteLibraryManager.html
  139. +1 −1 ConnichiwaDocs/native/html/Classes/CWServerManager.html
  140. +1 −1 ConnichiwaDocs/native/html/Classes/CWUtil.html
  141. +148 −1 ConnichiwaDocs/native/html/Classes/CWWebApplication.html
  142. +85 −1 ConnichiwaDocs/native/html/Classes/CWWebLibraryManager.html
  143. +1 −1 ConnichiwaDocs/native/html/Classes/CWiDevice.html
  144. +71 −71 ConnichiwaDocs/native/html/Classes/GCDWebServer.html
  145. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerBodyDecoder.html
  146. +1 −26 ConnichiwaDocs/native/html/Classes/GCDWebServerBodyEncoder.html
  147. +41 −41 ConnichiwaDocs/native/html/Classes/GCDWebServerConnection.html
  148. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerDataRequest.html
  149. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerDataResponse.html
  150. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerErrorResponse.html
  151. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerFileRequest.html
  152. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerFileResponse.html
  153. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerGZipDecoder.html
  154. +1 −26 ConnichiwaDocs/native/html/Classes/GCDWebServerGZipEncoder.html
  155. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerHandler.html
  156. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerMIMEStreamParser.html
  157. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerMultiPart.html
  158. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerMultiPartArgument.html
  159. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerMultiPartFile.html
  160. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerMultiPartFormRequest.html
  161. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerRequest.html
  162. +1 −26 ConnichiwaDocs/native/html/Classes/GCDWebServerResponse.html
  163. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerStreamedResponse.html
  164. +1 −1 ConnichiwaDocs/native/html/Classes/GCDWebServerURLEncodedFormRequest.html
  165. +1 −1 ConnichiwaDocs/native/html/Constants/CWBluetoothConnectionIPWriteState.html
  166. +1 −1 ConnichiwaDocs/native/html/Constants/CWBluetoothConnectionInitialDataState.html
  167. +1 −1 ConnichiwaDocs/native/html/Constants/CWBluetoothConnectionMCState.html
  168. +1 −1 ConnichiwaDocs/native/html/Constants/CWRemoteLibraryManagerState.html
  169. +1 −1 ConnichiwaDocs/native/html/Constants/CWServerManagerState.html
  170. +1 −1 ConnichiwaDocs/native/html/Constants/CWWebLibraryManagerState.html
  171. +1 −1 ConnichiwaDocs/native/html/Constants/CWiDeviceModel.html
  172. +1 −1 ConnichiwaDocs/native/html/Constants/GCDWebServerClientErrorHTTPStatusCode.html
  173. +1 −1 ConnichiwaDocs/native/html/Constants/GCDWebServerInformationalHTTPStatusCode.html
  174. +1 −1 ConnichiwaDocs/native/html/Constants/GCDWebServerLoggingLevel.html
  175. +1 −1 ConnichiwaDocs/native/html/Constants/GCDWebServerRedirectionHTTPStatusCode.html
  176. +1 −1 ConnichiwaDocs/native/html/Constants/GCDWebServerServerErrorHTTPStatusCode.html
  177. +1 −1 ConnichiwaDocs/native/html/Constants/GCDWebServerSuccessfulHTTPStatusCode.html
  178. +1 −1 ConnichiwaDocs/native/html/Protocols/CWBluetoothManagerDelegate.html
  179. +1 −1 ConnichiwaDocs/native/html/Protocols/CWBluetoothTransferManagerDelegate.html
  180. +1 −1 ConnichiwaDocs/native/html/Protocols/CWServerManagerDelegate.html
  181. +1 −1 ConnichiwaDocs/native/html/Protocols/CWWebApplicationState.html
  182. +43 −1 ConnichiwaDocs/native/html/Protocols/CWWebLibraryManagerDelegate.html
  183. +1 −26 ConnichiwaDocs/native/html/Protocols/GCDWebServerBodyReader.html
  184. +1 −1 ConnichiwaDocs/native/html/Protocols/GCDWebServerBodyWriter.html
  185. +1 −1 ConnichiwaDocs/native/html/Protocols/GCDWebServerDelegate.html
  186. +7 −1 ConnichiwaDocs/native/html/hierarchy.html
  187. +7 −1 ConnichiwaDocs/native/html/index.html
  188. +2 −2 ConnichiwaDocs/weblib/CWDatastore.html
  189. +6 −6 ConnichiwaDocs/weblib/CWDebug.html
  190. +2 −2 ConnichiwaDocs/weblib/CWDevice.html
  191. +2 −2 ConnichiwaDocs/weblib/CWDeviceManager.html
  192. +4 −4 ConnichiwaDocs/weblib/CWGyroscope.html
  193. +2 −2 ConnichiwaDocs/weblib/CWLocation.html
  194. +2 −2 ConnichiwaDocs/weblib/CWStitchManager.html
  195. +2 −2 ConnichiwaDocs/weblib/CWSystemInfo.html
  196. +2 −2 ConnichiwaDocs/weblib/CWTemplates.html
  197. +12 −12 ConnichiwaDocs/weblib/CWUtil.html
  198. +2 −2 ConnichiwaDocs/weblib/CWVector.html
  199. +2 −2 ConnichiwaDocs/weblib/Connichiwa.html
  200. +11 −13 ConnichiwaDocs/weblib/common_CWDatastore.js.html
  201. +12 −16 ConnichiwaDocs/weblib/common_CWDebug.js.html
  202. +2 −2 ConnichiwaDocs/weblib/common_CWDevice.js.html
  203. +9 −12 ConnichiwaDocs/weblib/common_CWGyroscope.js.html
  204. +2 −2 ConnichiwaDocs/weblib/common_CWLocation.js.html
  205. +13 −16 ConnichiwaDocs/weblib/common_CWStitchManager.js.html
  206. +7 −9 ConnichiwaDocs/weblib/common_CWSystemInfo.js.html
  207. +10 −12 ConnichiwaDocs/weblib/common_CWTemplates.js.html
  208. +14 −17 ConnichiwaDocs/weblib/common_CWUtil.js.html
  209. +2 −2 ConnichiwaDocs/weblib/common_CWVector.js.html
  210. +15 −17 ConnichiwaDocs/weblib/common_Connichiwa.js.html
  211. +2 −2 ConnichiwaDocs/weblib/common_DocTypes.js.html
  212. +10 −2 ConnichiwaDocs/weblib/common_EventTypes.js.html
  213. +2 −2 ConnichiwaDocs/weblib/common_jQueryExtensions.js.html
  214. +142 −8 ConnichiwaDocs/weblib/global.html
  215. +2 −2 ConnichiwaDocs/weblib/index.html
  216. +2 −2 ConnichiwaDocs/weblib/master_CWDevice.js.html
  217. +9 −11 ConnichiwaDocs/weblib/master_CWDeviceManager.js.html
  218. +11 −13 ConnichiwaDocs/weblib/master_CWStitchManager.js.html
  219. +13 −15 ConnichiwaDocs/weblib/master_ConnichiwaMaster.js.html
  220. +52 −3 ConnichiwaResources/weblib/connichiwa.js
  221. +2 −2 ConnichiwaResources/weblib/connichiwa.min.js
  222. +1 −1 ConnichiwaResources/weblib/connichiwa.min.js.map
  223. +70 −9 ConnichiwaResources/weblib/remote.js
  224. +2 −2 ConnichiwaResources/weblib/remote.min.js
  225. +1 −1 ConnichiwaResources/weblib/remote.min.js.map
  226. +2 −3 ConnichiwaResources/weblib_source/common/CWGyroscope.js
  227. +8 −0 ConnichiwaResources/weblib_source/common/EventTypes.js
  228. +6 −0 ConnichiwaResources/weblib_source/master/CWNativeBridge.js
  229. +24 −6 ConnichiwaResources/weblib_source/remote/CWNativeBridge.js
@@ -97,6 +97,8 @@
338EEBDC1B2C42A2009A5C3C /* server-handshake.c in Sources */ = {isa = PBXBuildFile; fileRef = 338EEBC91B2C42A2009A5C3C /* server-handshake.c */; };
338EEBDD1B2C42A2009A5C3C /* server.c in Sources */ = {isa = PBXBuildFile; fileRef = 338EEBCA1B2C42A2009A5C3C /* server.c */; };
338EEBDE1B2C42A2009A5C3C /* sha-1.c in Sources */ = {isa = PBXBuildFile; fileRef = 338EEBCB1B2C42A2009A5C3C /* sha-1.c */; };
3398CCDC1B2C9D9000EDD548 /* CWProximityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3398CCDA1B2C9D9000EDD548 /* CWProximityManager.h */; };
3398CCDD1B2C9D9000EDD548 /* CWProximityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3398CCDB1B2C9D9000EDD548 /* CWProximityManager.m */; };
33A05158193E61CC00FED071 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33A05157193E61CC00FED071 /* XCTest.framework */; };
33A0515E193E61CC00FED071 /* libConnichiwa.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 33A05146193E61CC00FED071 /* libConnichiwa.a */; };
33A05164193E61CC00FED071 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 33A05162193E61CC00FED071 /* InfoPlist.strings */; };
@@ -214,6 +216,10 @@
338EEBC91B2C42A2009A5C3C /* server-handshake.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "server-handshake.c"; sourceTree = "<group>"; };
338EEBCA1B2C42A2009A5C3C /* server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = server.c; sourceTree = "<group>"; };
338EEBCB1B2C42A2009A5C3C /* sha-1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "sha-1.c"; sourceTree = "<group>"; };
3398CCDA1B2C9D9000EDD548 /* CWProximityManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CWProximityManager.h; sourceTree = "<group>"; };
3398CCDB1B2C9D9000EDD548 /* CWProximityManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CWProximityManager.m; sourceTree = "<group>"; };
3398CCDE1B2C9E5A00EDD548 /* CWProximityManagerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CWProximityManagerDelegate.h; sourceTree = "<group>"; };
3398CCDF1B2D79E000EDD548 /* CWRemoteLibraryManagerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CWRemoteLibraryManagerDelegate.h; sourceTree = "<group>"; };
33A05146193E61CC00FED071 /* libConnichiwa.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libConnichiwa.a; sourceTree = BUILT_PRODUCTS_DIR; };
33A0514D193E61CC00FED071 /* Connichiwa-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Connichiwa-Prefix.pch"; sourceTree = "<group>"; };
33A0514E193E61CC00FED071 /* Connichiwa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Connichiwa.h; sourceTree = "<group>"; };
@@ -393,6 +399,9 @@
338EEBB81B2C2C2D009A5C3C /* Proximity Sensor */ = {
isa = PBXGroup;
children = (
3398CCDA1B2C9D9000EDD548 /* CWProximityManager.h */,
3398CCDB1B2C9D9000EDD548 /* CWProximityManager.m */,
3398CCDE1B2C9E5A00EDD548 /* CWProximityManagerDelegate.h */,
);
name = "Proximity Sensor";
sourceTree = "<group>";
@@ -454,6 +463,7 @@
33618ACA195E233D006FA51B /* CWWebLibraryManagerDelegate.h */,
33618ABE195DAD37006FA51B /* CWRemoteLibraryManager.h */,
33618ABF195DAD37006FA51B /* CWRemoteLibraryManager.m */,
3398CCDF1B2D79E000EDD548 /* CWRemoteLibraryManagerDelegate.h */,
330BA3D1193F8CB300D9E54C /* CWServerManager.h */,
330BA3D2193F8CB300D9E54C /* CWServerManager.m */,
3367186B194776C1000A7164 /* CWServerManagerDelegate.h */,
@@ -530,6 +540,7 @@
3367186C194776C1000A7164 /* CWServerManagerDelegate.h in Headers */,
334AB753193FDDF800A15999 /* CWDebug.h in Headers */,
33618AC8195DEDFE006FA51B /* CWWebLibraryManager.h in Headers */,
3398CCDC1B2C9D9000EDD548 /* CWProximityManager.h in Headers */,
3338A7B41A71204300898D4E /* GCDWebServerURLEncodedFormRequest.h in Headers */,
3338A7AE1A71204300898D4E /* GCDWebServerDataRequest.h in Headers */,
338EEBDB1B2C42A2009A5C3C /* private-libwebsockets.h in Headers */,
@@ -774,6 +785,7 @@
3338A7BD1A71204300898D4E /* GCDWebServerStreamedResponse.m in Sources */,
338EEBD11B2C42A2009A5C3C /* extension-deflate-frame.c in Sources */,
3338A7A51A71204300898D4E /* GCDWebServerConnection.m in Sources */,
3398CCDD1B2C9D9000EDD548 /* CWProximityManager.m in Sources */,
33A87DF81951037A001BDC09 /* CWBluetoothConnection.m in Sources */,
330BA3D4193F8CB300D9E54C /* CWServerManager.m in Sources */,
3338A7B71A71204300898D4E /* GCDWebServerDataResponse.m in Sources */,
@@ -89,7 +89,7 @@ - (void)addNewRSSIMeasure:(double)rssi
//We sometimes get this value - it's nothing bad as long as it doesn't occur too often, just ignore it
if (rssi == 127) return;
BTLog(5, @"Adding RSSI %.0f to device %@", rssi, self.identifier);
BTLog(6, @"Adding RSSI %.0f to device %@", rssi, self.identifier);
//We use an exponential weighted moving average to compensate for outlier of the RSSI but still react quickly to heavy distance changes
//Formula: (1-α)*oldAverage + α*newSample ; with α being the weighting factor of new samples (bigger α means new values are adapted more quickly, but the average is more vulnerable to outlier)
@@ -882,7 +882,7 @@ - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeri
}
else
{
BTLog(5, @"Re-discovered existing device %@", existingConnection.identifier);
BTLog(6, @"Re-discovered existing device %@", existingConnection.identifier);
[existingConnection updateLastSeen];
[self _addRSSIMeasure:[RSSI doubleValue] toConnection:existingConnection];
}
@@ -0,0 +1,21 @@
//
// CWProximitySensor.h
// Connichiwa
//
// Created by Mario Schreiner on 13/06/15.
// Copyright (c) 2015 Mario Schreiner. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "CWProximityManagerDelegate.h"
@interface CWProximityManager : NSObject
@property (readwrite) id<CWProximityManagerDelegate> delegate;
-(void)startMonitoring;
-(void)stopMonitoring;
@end
@@ -0,0 +1,49 @@
//
// CWProximitySensor.m
// Connichiwa
//
// Created by Mario Schreiner on 13/06/15.
// Copyright (c) 2015 Mario Schreiner. All rights reserved.
//
#import "CWProximityManager.h"
@interface CWProximityManager()
-(void)_proximitySensorStateChanged;
@end
@implementation CWProximityManager
- (instancetype)init {
self = [super init];
//Setup the change event handler
//The event handler will not be called until UIDevice's
//setProximityMonitoringEnabled is set to YES (see start/stopMonitoring)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_proximitySensorStateChanged)
name:UIDeviceProximityStateDidChangeNotification
object:nil];
return self;
}
-(void)startMonitoring {
[[UIDevice currentDevice] setProximityMonitoringEnabled:YES];
}
-(void)stopMonitoring {
[[UIDevice currentDevice] setProximityMonitoringEnabled:NO];
}
-(void)_proximitySensorStateChanged {
if ([self.delegate respondsToSelector:@selector(proximityStateChanged:)]) {
[self.delegate proximityStateChanged:[[UIDevice currentDevice] proximityState]];
}
}
@end
@@ -0,0 +1,15 @@
//
// CWProximityManagerDelegate.h
// Connichiwa
//
// Created by Mario Schreiner on 13/06/15.
// Copyright (c) 2015 Mario Schreiner. All rights reserved.
//
@protocol CWProximityManagerDelegate <NSObject>
@optional
-(void)proximityStateChanged:(BOOL)proximityState;
@end
@@ -10,6 +10,7 @@
#import <UIKit/UIKit.h>
#import <JavaScriptCore/JavaScriptCore.h>
#import "CWWebApplicationState.h"
#import "CWRemoteLibraryManagerDelegate.h"
@@ -48,6 +49,12 @@ typedef NS_ENUM(NSInteger, CWRemoteLibraryManagerState)
*/
@interface CWRemoteLibraryManager : NSObject
/**
* The delegate this class sends events to
*/
@property (readwrite, strong) id<CWRemoteLibraryManagerDelegate> delegate;
/**
* The remote webview where the connection to remote devices will be established. Must be set to a UIWebView that is not used for any other purposes. This class will become the delegate of that UIWebView. Also, the UIWebView will automatically be hidden/unhidden depending on the remote state of this devie.
*/
@@ -69,6 +76,8 @@ typedef NS_ENUM(NSInteger, CWRemoteLibraryManagerState)
*/
- (BOOL)isActive;
- (void)sendProximityStateChanged:(BOOL)proximityState;
/**
* Connects us as a remote device to the connichiwa webserver at the given URL
*
@@ -59,6 +59,8 @@ - (void)_sendToView_disconnectWebsocket;
*/
- (void)_sendToView_localInfo;
- (void)_sendToView_proximityStateChanged:(BOOL)proximityState;
/**
* Sends the given dictionary to the remote library as a JSON string
*
@@ -143,6 +145,12 @@ - (BOOL)isActive
}
- (void)sendProximityStateChanged:(BOOL)proximityState
{
[self _sendToView_proximityStateChanged:proximityState];
}
#pragma mark WebView Communication
@@ -163,6 +171,14 @@ - (void)_registerJSCallbacks
self.webViewContext[@"nativeSoftDisconnect"] = ^{
[weakSelf _receivedfromView_softDisconnect];
};
self.webViewContext[@"nativeCallStartProximityTracking"] = ^{
[weakSelf _receivedFromView_startProximityTracking];
};
self.webViewContext[@"nativeCallStopProximityTracking"] = ^{
[weakSelf _receivedFromView_stopProximityTracking];
};
}
@@ -209,6 +225,24 @@ - (void)_receivedfromView_softDisconnect
}
-(void)_receivedFromView_startProximityTracking {
CWLog(3, @"Remote Library requested proximity tracking start.");
if ([self.delegate respondsToSelector:@selector(remoteLibraryRequestsProximityTrackingStart)])
{
[self.delegate remoteLibraryRequestsProximityTrackingStart];
}
}
-(void)_receivedFromView_stopProximityTracking {
CWLog(3, @"Remote Library requested proximity tracking stop.");
if ([self.delegate respondsToSelector:@selector(remoteLibraryRequestsProximityTrackingStop)])
{
[self.delegate remoteLibraryRequestsProximityTrackingStop];
}
}
- (void)_sendToView_disconnectWebsocket
{
NSDictionary *data = @{
@@ -227,6 +261,15 @@ - (void)_sendToView_localInfo
}
- (void)_sendToView_proximityStateChanged:(BOOL)proximityState; {
NSDictionary *data = @{
@"_name": @"proximitystatechanged",
@"proximityState": @(proximityState)
};
[self _sendToView_dictionary:data];
}
- (void)_sendToView_dictionary:(NSDictionary *)dictionary
{
NSString *json = [CWUtil escapedJSONStringFromDictionary:dictionary];
@@ -0,0 +1,22 @@
//
// CWRemoteLibraryManagerDelegate.h
// Connichiwa
//
// Created by Mario Schreiner on 14/06/15.
// Copyright (c) 2015 Mario Schreiner. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* A delegate protocol that receives different events from the CWRemoteLibraryManager (and therefore also from the remote web library)
*/
@protocol CWRemoteLibraryManagerDelegate <NSObject>
- (void)remoteLibraryRequestsProximityTrackingStart;
- (void)remoteLibraryRequestsProximityTrackingStop;
@end
@@ -15,6 +15,8 @@
#import "CWRemoteLibraryManager.h"
#import "CWWebLibraryManager.h"
#import "CWWebLibraryManagerDelegate.h"
#import "CWProximityManager.h"
#import "CWProximityManagerDelegate.h"
#import "CWUtil.h"
#import "CWiDevice.h"
#import "CWDebug.h"
@@ -27,7 +29,7 @@
@interface CWWebApplication () <CWServerManagerDelegate, CWBluetoothManagerDelegate, CWWebApplicationState, CWWebLibraryManagerDelegate>
@interface CWWebApplication () <CWServerManagerDelegate, CWBluetoothManagerDelegate, CWWebApplicationState, CWWebLibraryManagerDelegate, CWProximityManagerDelegate, CWRemoteLibraryManagerDelegate>
/**
* The unique identifier of this device that is used amongst all the different parts of Connichiwa
@@ -61,6 +63,8 @@ @interface CWWebApplication () <CWServerManagerDelegate, CWBluetoothManagerDeleg
*/
@property (readwrite, strong) CWBluetoothManager *bluetoothManager;
@property (readwrite, strong) CWProximityManager *proximityManager;
/**
* The local UIWebView where the web application will be displayed on
*/
@@ -120,13 +124,17 @@ - (instancetype)init
[self.webLibManager setDelegate:self];
self.remoteLibManager = [[CWRemoteLibraryManager alloc] initWithApplicationState:self];
[self.remoteLibManager setDelegate:self];
self.webserverManager = [[CWServerManager alloc] init];
[self.webserverManager setDelegate:self];
self.bluetoothManager = [[CWBluetoothManager alloc] initWithApplicationState:self];
[self.bluetoothManager setDelegate:self];
self.proximityManager = [[CWProximityManager alloc] init];
[self.proximityManager setDelegate:self];
NSArray *ips = [CWUtil deviceInterfaceAddresses];
if ([ips count] > 0) {
CWLog(1, @"IP: %@", [ips objectAtIndex:0]);
@@ -144,6 +152,10 @@ - (void)launchWithDocumentRoot:(NSString *)documentRoot onWebview:(UIWebView *)w
[self.webserverManager startWebserverWithDocumentRoot:documentRoot onPort:port];
}
-(void)proximitySensorStateChanged {
NSLog(@"CHANGE");
}
- (void)launchWithDocumentRoot:(NSString *)documentRoot onWebview:(UIWebView *)webView;
{
@@ -316,6 +328,29 @@ - (void)remoteDidConnect:(NSString *)identifier
}
- (void)webLibraryRequestsProximityTrackingStart {
[self.proximityManager startMonitoring];
}
- (void)webLibraryRequestsProximityTrackingStop {
[self.proximityManager stopMonitoring];
}
#pragma mark CWRemoteLibraryManagerDelegate
- (void)remoteLibraryRequestsProximityTrackingStart {
[self.proximityManager startMonitoring];
}
- (void)remoteLibraryRequestsProximityTrackingStop {
[self.proximityManager stopMonitoring];
}
#pragma mark CWWebserverManagerDelegate
@@ -418,6 +453,15 @@ - (void)didSendNetworkAddresses:(NSString *)deviceIdentifier success:(BOOL)succe
}
#pragma mark CWProximityManagerDelegate
-(void)proximityStateChanged:(BOOL)proximityState {
[self.webLibManager sendProximityStateChanged:proximityState];
[self.remoteLibManager sendProximityStateChanged:proximityState];
}
#pragma mark ApplicationDelegate Forwards
Oops, something went wrong.

0 comments on commit c6f4fee

Please sign in to comment.