getState
state = peripheral:getState()
Returns the connection state - disconnected, connecting, connected, disconnecting.
function isConnected(peripheral)
return peripheral:getState() == bleCentral.CONNECTED
end
Introduced in platform.apiLevel = '2.5'