@@ -5,7 +5,7 @@ An iOS library that provides Continuous Sensing functionality to your applicatio
55
66## Supported Sensors
77
8- The following mobile sensors are currently supported in SensingKit-iOS, (listed in [ SKSensorType] ( SensingKit/SKSensorType.h ) enum):
8+ The following mobile sensors are currently supported in SensingKit-iOS (listed in [ SKSensorType] ( SensingKit/SKSensorType.h ) enum):
99
1010- Accelerometer
1111- Gyroscope
@@ -14,12 +14,14 @@ The following mobile sensors are currently supported in SensingKit-iOS, (listed
1414- Motion Activity
1515- Pedometer
1616- Altimeter
17- - Battery
17+ - BatteryStatus
1818- Location
1919- Heading
2020- iBeacon™ Proximity
2121- Eddystone™ Proximity
2222- Microphone
23+ - Screen Brightness
24+ - Network Connection
2325
2426
2527## Installing the Library
@@ -33,7 +35,7 @@ $ gem install cocoapods
3335To integrate SensingKit into your Xcode project, specify it in your ` Podfile ` :
3436
3537``` ruby
36- target < MyApp > do
38+ target ' MyApp' do
3739 # Uncomment this line if you're using Swift or would like to use dynamic frameworks
3840 use_frameworks!
3941
@@ -82,30 +84,30 @@ Check if a sensor is available in the device:
8284
8385* Objective-C*
8486``` objectivec
85- if ([self .sensingKit isSensorAvailable: Battery ] ) {
87+ if ([self .sensingKit isSensorAvailable: BatteryStatus ] ) {
8688 // You can access the sensor
8789}
8890```
8991
9092*Swift*
9193```swift
92- if sensingKit.isSensorAvailable(SKSensorType.Battery ) {
94+ if sensingKit.isSensorAvailable(SKSensorType.BatteryStatus ) {
9395 // You can access the sensor
9496}
9597```
9698
9799
98- Register a sensor (e.g. a Battery sensor) as shown below:
100+ Register a sensor (e.g. a BatteryStatus sensor) as shown below:
99101
100102* Objective-C*
101103``` objectivec
102- [self .sensingKit registerSensor: Battery error: NULL ] ;
104+ [self .sensingKit registerSensor: BatteryStatus error: NULL ] ;
103105```
104106
105107*Swift*
106108```swift
107109do {
108- try sensingKit.register(SKSensorType.Battery )
110+ try sensingKit.register(SKSensorType.BatteryStatus )
109111}
110112catch {
111113 // Handle error
@@ -117,24 +119,24 @@ Subscribe a sensor data handler. You can cast the data object into the actual se
117119
118120* Objective-C*
119121``` objectivec
120- [self .sensingKit subscribeToSensor: Battery
122+ [self .sensingKit subscribeToSensor: BatteryStatus
121123 withHandler:^(SKSensorType sensorType, SKSensorData * sensorData, NSError * error) {
122124
123125 if (!error) {
124- SKBatteryData *batteryData = (SKBatteryData *)sensorData;
125- NSLog(@"Battery Level: %f", batteryData .level);
126+ SKBatteryStatusData *batteryStatusData = (SKBatteryStatusData *)sensorData;
127+ NSLog(@"Battery Level: %f", batteryStatusData .level);
126128 }
127129 } error:NULL];
128130```
129131
130132*Swift*
131133```swift
132134do {
133- try sensingKit.subscribe(to: SKSensorType.Battery , withHandler: { (sensorType, sensorData, error) in
135+ try sensingKit.subscribe(to: SKSensorType.BatteryStatus , withHandler: { (sensorType, sensorData, error) in
134136
135137 if (error == nil) {
136- let batteryData = sensorData as! SKBatteryData
137- print("Battery Level: \(batteryData )")
138+ let batteryStatusData = sensorData as! SKBatteryStatusData
139+ print("Battery Level: \(batteryStatusData.level )")
138140 }
139141 })
140142}
@@ -149,25 +151,25 @@ You can Start and Stop the Continuous Sensing using the following commands:
149151* Objective-C*
150152``` objectivec
151153// Start
152- [self .sensingKit startContinuousSensingWithSensor: Battery error: NULL ] ;
154+ [self .sensingKit startContinuousSensingWithSensor: BatteryStatus error: NULL ] ;
153155
154156// Stop
155- [ self.sensingKit stopContinuousSensingWithSensor: Battery error: NULL ] ;
157+ [ self.sensingKit stopContinuousSensingWithSensor: BatteryStatus error: NULL ] ;
156158```
157159
158160*Swift*
159161```swift
160162// Start
161163do {
162- try sensingKit.startContinuousSensing(with:SKSensorType.Battery )
164+ try sensingKit.startContinuousSensing(with:SKSensorType.BatteryStatus )
163165}
164166catch {
165167 // Handle error
166168}
167169
168170// Stop
169171do {
170- try sensingKit.stopContinuousSensing(with:SKSensorType.Battery )
172+ try sensingKit.stopContinuousSensing(with:SKSensorType.BatteryStatus )
171173}
172174catch {
173175 // Handle error
@@ -185,8 +187,11 @@ Depending on the used sensor and its configuration, some keys with a user-friend
185187### Microphone
186188- NSMicrophoneUsageDescription
187189
188- ### Eddystone
189- - NSBluetoothPeripheralUsageDescription
190+ ### iBeacon™ Proximity
191+ - NSBluetoothAlwaysUsageDescription (when Broadcasting only)
192+
193+ ### Eddystone™ Proximity
194+ - NSBluetoothAlwaysUsageDescription
190195
191196### Location
192197- NSLocationAlwaysUsageDescription
@@ -201,7 +206,7 @@ Depending on the used sensor and its configuration, some keys with a user-friend
201206
202207```
203208Copyright (c) 2014. Kleomenis Katevas
204- Kleomenis Katevas, k.katevas@imperial.ac.uk
209+ Kleomenis Katevas, minos.kat@gmail.com
205210
206211This file is part of SensingKit-iOS library.
207212For more information, please visit https://www.sensingkit.org
0 commit comments