我想把我的蓝色装置放在我的嵌入的含水层上。 我可以人工执行以下指挥系统,使我的BT装置能够使用,并能从BALE扫描仪中扫描。
#bluetoothctl
#menu advertise
#manufacturer 0xffff 0x12 0x34
#name myAX564
#discoverable on
#back
#advertise on
#menu gatt
#register-service e2d36f99-8909-4136-9a49-d825508b297b
#register-characteristic 0x1234 read
#register-characteristic 0x4567 read,write
#register-application
#back
#power on
然而,当我试图用文字处理时,我总是在“登记-申请”之后会见了“org.bluex.Error.Failed”。
下面是我的文字,是否有人能够帮助?
#!/usr/bin/expect -f
spawn bluetoothctl
expect "Agent registered"
sleep 1
send -- "menu advertise
"
expect "Menu advertise:"
sleep 2
send -- "manufacturer 0xffff 0x12 0x34
"
send -- "name myAX564
"
send -- "discoverable on
"
send -- "back
"
expect "Menu main:"
sleep 2
send -- "advertise on
"
expect "Advertising object registered "
sleep 4
send -- "menu gatt
"
expect "Menu gatt:"
sleep 4
send -- "register-service e2d36f99-8909-4136-9a49-d825508b297b
"
expect "Primary (yes/no):"
sleep 2
send -- "yes
"
sleep 4
send -- "register-characteristic 0x1234 read
"
expect "Enter value:"
sleep 2
send -- "0xFA
"
sleep 4
send -- "register-characteristic 0x4567 read, write
"
expect "Enter value:"
sleep 2
send -- "0xFE
"
sleep 4
send -- "register-application
"
sleep 5
expect "Application registered"
send -- "back
"
expect "Menu main:"
send -- "power on
"
expect "Changeing power on succeed"
send -- "exit
"