idx=0 idxmax=1000 while idx < idxmax Send_HCI_Reset #Wait_HCI_Command_Complete_Reset_Event sleep 2000 Send_GAP_DeviceInit 0x04, 20, 0, 0, 1 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFE00, Wait_HCI_Vendor_Specific_Event 10000, 0x0600, 0x00, , , , , Send_GATT_AddService 0x2800, 5 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFDFC, Send_GATT_AddAttribute "03:28", 3 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFDFE, Send_GATT_AddAttribute "e1:ff", 3 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFDFE, Send_GATT_AddAttribute "03:28", 3 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFDFE, Send_GATT_AddAttribute "e2:ff", 3 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFDFE, Send_GAP_UpdateAdvertisingData 1, "02:01:06" Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFE07, Wait_HCI_Vendor_Specific_Event , 0x0602, 0x00, Send_GAP_MakeDiscoverable 0, 0x00, 0, 0x07, 0x00 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFE06, Wait_HCI_Vendor_Specific_Event , 0x0603, sleep 5000 Send_GAP_EndDiscoverable Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFE08, Wait_HCI_Vendor_Specific_Event , 0x0604, Send_HCI_Reset #Wait_HCI_Command_Complete_Reset_Event sleep 2000 Send_GAP_DeviceInit 0x08, 20, 0, 0, 1 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFE00, Wait_HCI_Vendor_Specific_Event 10000, 0x0600, 0x00, , , , , Send_GAP_SetParam 36,-127 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFE30, Send_GAP_SetParam 2,2000 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFE30, index=0 indexMax=20 while index < indexMax #Send_GAP_SetParam 16,16 #Send_GAP_SetParam 17,16 Send_GAP_DeviceDiscoveryRequest 3, 0, 0 Wait_HCI_Vendor_Specific_Event , 0x067F, 0x00, 0xFE04, Wait_HCI_Vendor_Specific_Event , 0x060D, 0x00, , , , , , sleep 2100 index++ wend idx++ wend