EasyManuals Logo

RF-Star nRF52832 User Manual

RF-Star nRF52832
59 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #48 background imageLoading...
Page #48 background image
nRF52832
www.szrfstar.com V1.3 - Sep., 2020
Shenzhen RF-star Technology Co., Ltd. Page 47 of 58
8 iOS APP Programming Reference
The module is always to broadcast as slave, waiting for mobile phone to scan and connect as master. The scanning and
connection are usually completed by APP. Due to the particularity of BLE protocol, there is no need to scan and connect
Bluetooth LE devices in the system settings of the Smart phone. Smart devices are responsible for BLE connection,
communication, disconnection, etc. And usually it is implemented by the APP.
Regarding BLE programming in iOS, the key point is the read, write and enable notify switch to Characteristic (or
called channel) to. To read and write in the channel can realize the direct control on the direct-drive mode functions of
the module and no extra MCU is needed. Typical functions that are involved are as follows:
/*!
* @method writeValue:forCharacteristic:withResponse:
* @param data The value to write.
* @param characteristic The characteristic on which to perform the write operation.
* @param type The type of write to be executed.
* @discussion Write the value of a characteristic.
* The passed data is copied and can be disposed of after the call finishes.
* The relevant delegate callback will then be invoked with the status of the request.
* @see peripheral:didWriteValueForCharacteristic:error:
*/
- (void)writeValue:(NSData *)data forCharacteristic:(CBCharacteristic *)characteristic
type:(CBCharacteristicWriteType)type;
Note: to write to a characteristic.
NSData *d = [[NSData alloc] initWithBytes:&data length:mdata.length];
[p writeValue:d
forCharacteristic:c
type:CBCharacteristicWriteWithoutResponse];
/*!
* @method readValueForCharacteristic:
* @param characteristic The characteristic for which the value needs to be read.
* @discussion Fetch the value of a characteristic.
* The relevant delegate callback will then be invoked with the status of the request.
* @see peripheral:didUpdateValueForCharacteristic:error:

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the RF-Star nRF52832 and is the answer not in the manual?

RF-Star nRF52832 Specifications

General IconGeneral
BrandRF-Star
ModelnRF52832
CategoryControl Unit
LanguageEnglish