Datasheet
BLEClientCts
BLEClientCts is a helper class that implements adopted Current Time Service (https://adafru.it/BiT) , which enables you
to receive time from devices such as an iPhone or iPad.
API
Client CTS OLED Example
The client_cts_oled (https://adafru.it/BiU) example uses the Adafruit FeatherWing OLED (https://adafru.it/sao) to
display received time.
Sketch Requirements
In order to use this example sketch the following libraries must be installed on your system:
The Bluefruit nRF52 Feather codebase is in an early BETA stage and is undergoing active development
based on customer feedback and testing. As such, the class documentation here is incomplete, and you
should consult the Github repo for the latest code and API developments: https://goo.gl/LdEx62
// Callback Signatures
typedef void (*adjust_callback_t) (uint8_t reason);
BLEClientCts(void);
virtual bool begin(void);
virtual bool discover(uint16_t conn_handle);
bool getCurrentTime(void);
bool getLocalTimeInfo(void);
bool enableAdjust(void);
void setAdjustCallback(adjust_callback_t fp);
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.current_time.xml
struct ATTR_PACKED {
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
uint8_t weekday;
uint8_t subsecond;
uint8_t adjust_reason;
} Time;
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.local_time_information.xml
struct ATTR_PACKED {
int8_t timezone;
uint8_t dst_offset;
}LocalInfo;
© Adafruit Industries https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide Page 150 of 175