File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -56,14 +56,26 @@ func (a *Advertisement) Configure(options AdvertisementOptions) error {
56
56
return errAdvertisementPacketTooBig
57
57
}
58
58
59
+ var typ uint8
60
+ switch options .AdvertisementType {
61
+ case AdvertisingTypeInd :
62
+ typ = C .BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED
63
+ case AdvertisingTypeDirectInd :
64
+ typ = C .BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED
65
+ case AdvertisingTypeScanInd :
66
+ typ = C .BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED
67
+ case AdvertisingTypeNonConnInd :
68
+ typ = C .BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED
69
+ }
70
+
59
71
data := C.ble_gap_adv_data_t {}
60
72
data .adv_data = C.ble_data_t {
61
73
p_data : (* C .uint8_t )(unsafe .Pointer (& a .payload .data [0 ])),
62
74
len : C .uint16_t (a .payload .len ),
63
75
}
64
76
params := C.ble_gap_adv_params_t {
65
77
properties : C.ble_gap_adv_properties_t {
66
- _type : C . BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED ,
78
+ _type : typ ,
67
79
},
68
80
interval : C .uint32_t (options .Interval ),
69
81
}
You can’t perform that action at this time.
0 commit comments