#ClearTrace True #Send_HCI_Reset #sleep 2000 #Send_HCI_EXT_SetBDADDR "B0:B4:48:DB:D8:03" #Wait_HCI_Vendor_Specific_Event 5000, 0x040c,0x00 ,0xfc0c Send_GAP_DeviceInit 0x04, 10, 0, 0, 1 Wait_HCI_Vendor_Specific_Event 5000, 0x067F, 0x00, , Wait_HCI_Vendor_Specific_Event 5000, 0x0600,, , , , , #adv 160*0.625=100ms Send_GAP_SetParam 8, 3000 Send_GAP_SetParam 9, 3000 #mesure 106ms #con Send_GAP_SetParam 21, 6 Send_GAP_SetParam 22, 10000 #mesure 100ms Send_GAP_SetParam 25, 10000 Send_GAP_SetParam 26, 0 Sleep 1000 #handle 1 GATT Primary Service Declaration Send_GATT_AddService 0x2800,7 Wait_HCI_Vendor_Specific_Event 5000, 0x067F, 0x00, , #handle 2 GATT Characteristic Declaration Send_GATT_AddAttribute "03:28", 0x01 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #handle 3 Device Name Send_GATT_AddAttribute "00:2A", 0x01 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #handle 4 GATT Characteristic Declaration Send_GATT_AddAttribute "03:28", 0x01 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #handle 5 Appearance Send_GATT_AddAttribute "01:2A", 0x01 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #handle 6 GATT Characteristic Declaration Send_GATT_AddAttribute "03:28", 0x01 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #handle 7 Peripheral Prefered Connection ... Send_GATT_AddAttribute "04:2A", 0x01 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #handle 1 GATT Primary Service Declaration Send_GATT_AddService 0x2800, 5 Wait_HCI_Vendor_Specific_Event 5000, 0x067F, 0x00, , #Add GATT Characteristic Declaration Send_GATT_AddAttribute "03:28", 0x01 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #Add Key Press state Send_GATT_AddAttribute "E1:FF", 0x01 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #Add Client Characteristic Configuration Send_GATT_AddAttribute "02:29", 0x03 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #Characteristique User Description Send_GATT_AddAttribute "01:29", 0x01 Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xfdfe, #02:01:06 : BLE compatibility #05:09:54:45:53:54 : Name : TEST #03:FF:B6:02 : Manufacter Id : Schneider Send_GAP_UpdateAdvertisingData 1, "02:01:06:05:09:54:45:53:54:03:FF:B6:02" Wait_HCI_Vendor_Specific_Event 5000, 0x067F, 0x00,, Wait_HCI_Vendor_Specific_Event 5000, 0x0602,0x00, #Send_GAP_UpdateAdvertisingData 0, "03:09:41:42" #Wait_HCI_Vendor_Specific_Event 5000, 0x067F, 0x00,, #Wait_HCI_Vendor_Specific_Event 5000, 0x0602,0x00, Send_GAP_MakeDiscoverable 0, 0, 0, 0x07, 0x00 Wait_HCI_Vendor_Specific_Event 5000, 0x067F, 0x00, 0xfe06, Wait_HCI_Vendor_Specific_Event 5000, 0x0603, 0x00 #Wait Establish Wait_HCI_Vendor_Specific_Event 0, 0x0605, 0x00, , , , , , , , #Wait Att_ReadByGrpTypeReq Wait_HCI_Vendor_Specific_Event 0, 0x0510, 0x00, , , , Send_ATT_ReadByGrpTypeRsp 0, 6, "0100070000180800FFFFE0FF" Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xFD11, #Wait Att_ReadByTypeReq Wait_HCI_Vendor_Specific_Event 0, 0x0508, 0x00, , , , Send_ATT_ReadByTypeRsp 0, 7, "0200020300002A0400020500012A0600020700042A" Wait_HCI_Vendor_Specific_Event 0, 0x067f, 0, 0xFD09, Wait_HCI_Vendor_Specific_Event 0, 0x0508, 0x00, , , , Send_ATT_ReadByTypeRsp 0, 7, "0900100A00E1FF"