nrf5/modules: Adding a few examples in the modubluepy.h to get easier copy paste when implementing.
This commit is contained in:
parent
b65553e57f
commit
ff9cefa6b2
|
@ -27,6 +27,25 @@
|
||||||
#ifndef UBLUEPY_H__
|
#ifndef UBLUEPY_H__
|
||||||
#define UBLUEPY_H__
|
#define UBLUEPY_H__
|
||||||
|
|
||||||
|
/* Examples:
|
||||||
|
|
||||||
|
Advertisment:
|
||||||
|
|
||||||
|
from ubluepy import Peripheral
|
||||||
|
p = Peripheral()
|
||||||
|
p.advertise(device_name="MicroPython")
|
||||||
|
|
||||||
|
DB setup:
|
||||||
|
|
||||||
|
from ubluepy import Service, Characteristic, UUID
|
||||||
|
u0 = UUID("6e400001-b5a3-f393-e0a9-e50e24dcca9e")
|
||||||
|
s = Service(u0)
|
||||||
|
u1 = UUID("6e400002-b5a3-f393-e0a9-e50e24dcca9e")
|
||||||
|
c = Characteristic(u1)
|
||||||
|
s.addCharacteristic(c)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
#include "py/obj.h"
|
#include "py/obj.h"
|
||||||
|
|
||||||
extern const mp_obj_type_t ubluepy_uuid_type;
|
extern const mp_obj_type_t ubluepy_uuid_type;
|
||||||
|
|
Loading…
Reference in New Issue