useIsSigmeshGatewayConnected(devId: string)

Requires:
@ray-js/panel-sdk≥1.8.0

Description

Determine whether a SIG Mesh device is connected via a gateway (not direct Bluetooth)

Parameters

ParameterTypeRequiredDescription
devIdstringYesSigmesh device ID

Return Value

Type: boolean
Boolean. true means the device is connected via a gateway; false means direct Bluetooth or offline

Examples

Example

import { useIsSigmeshGatewayConnected } from '@ray-js/panel-sdk';

function MeshDeviceInfo({ devId }: { devId: string }) {
  const isGatewayConnected = useIsSigmeshGatewayConnected(devId);
  return (
    <Text>
      {isGatewayConnected ? 'Connected via gateway' : 'Direct Bluetooth connection'}
    </Text>
  );
}