[nRF52840] UART service advertising error.
Posted: Tue Mar 12, 2019 1:48 pm
Hello!
I tried to send and receive UART data communication with iPhone app.
OS error found advertise function; OSError: Can not apply advertisment data. status: 0x09
I tried to advertise without params, advertise function did not return error.
But, connect with iPhone was unstable(connected and disconnected continuously) and no response for data sending.
How can I fix this?
===============
# the Nordic UART Service.
uuid_spp_vender_specific = UUID("6E400001-B5A3-F393-E0A9-E50E24DCCA9E")
uuid_spp_rx_characteristic = UUID("6E400002-B5A3-F393-E0A9-E50E24DCCA9E")
uuid_spp_tx_characteristic = UUID("6E400003-B5A3-F393-E0A9-E50E24DCCA9E")
periph = Peripheral()
service_SPP = Service(uuid_spp_vender_specific)
SPP_rx_pros = Characteristic.PROP_WRITE
SPP_rx_attrs = Characteristic.ATTR_CCCD
SPP_rx_characteristic = Characteristic(uuid_spp_rx_characteristic, props = SPP_rx_pros, attrs = SPP_rx_attrs)
service_SPP.addCharacteristic(SPP_rx_characteristic)
SPP_tx_pros = Characteristic.PROP_NOTIFY
SPP_tx_attrs = Characteristic.ATTR_CCCD
SPP_tx_characteristic = Characteristic(uuid_spp_tx_characteristic, props = SPP_tx_pros, attrs = SPP_tx_attrs)
service_SPP.addCharacteristic(SPP_tx_characteristic)
periph.addService(service_SPP)
periph.setConnectionHandler(event_handler)
periph.advertise(device_name="nRF52", services=[service_SPP])
I tried to send and receive UART data communication with iPhone app.
OS error found advertise function; OSError: Can not apply advertisment data. status: 0x09
I tried to advertise without params, advertise function did not return error.
But, connect with iPhone was unstable(connected and disconnected continuously) and no response for data sending.
How can I fix this?
===============
# the Nordic UART Service.
uuid_spp_vender_specific = UUID("6E400001-B5A3-F393-E0A9-E50E24DCCA9E")
uuid_spp_rx_characteristic = UUID("6E400002-B5A3-F393-E0A9-E50E24DCCA9E")
uuid_spp_tx_characteristic = UUID("6E400003-B5A3-F393-E0A9-E50E24DCCA9E")
periph = Peripheral()
service_SPP = Service(uuid_spp_vender_specific)
SPP_rx_pros = Characteristic.PROP_WRITE
SPP_rx_attrs = Characteristic.ATTR_CCCD
SPP_rx_characteristic = Characteristic(uuid_spp_rx_characteristic, props = SPP_rx_pros, attrs = SPP_rx_attrs)
service_SPP.addCharacteristic(SPP_rx_characteristic)
SPP_tx_pros = Characteristic.PROP_NOTIFY
SPP_tx_attrs = Characteristic.ATTR_CCCD
SPP_tx_characteristic = Characteristic(uuid_spp_tx_characteristic, props = SPP_tx_pros, attrs = SPP_tx_attrs)
service_SPP.addCharacteristic(SPP_tx_characteristic)
periph.addService(service_SPP)
periph.setConnectionHandler(event_handler)
periph.advertise(device_name="nRF52", services=[service_SPP])