netLed - netLed Network status indicator#

Adaptation status unknown

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Example

--Note: due to the use of sys.wait() all apis need to be used in the coroutine
-- Usage Examples
local netLed = require ("netLed")

local LEDA = gpio.setup(27,1,gpio.PULLUP) --LED End of pin judgment assignment
sys.taskInit(function()
--Breathing light
sys.wait(5080)--Delay 5 seconds waiting for network registration
log.info("mobile.status()", mobile.status())
  while true do
        if mobile.status() == 1 then--Registered
            sys.wait(688)
            netLed.setupBreateLed(LEDA)
        end
   end
end)

netLed.setState#

Update the working status indicated by the network lights

Parameters

None

Return Value

return value type

explanation

nil

No return value

Examples

netLed.setState()

netLed.taskLed(ledPinSetFunc)#

Running Tasks for Network Indicator Module

Parameters

None

Return Value

return value type

explanation

nil

No return value

Examples

local LEDA = gpio.setup(27,1,gpio.PULLUP) --LED End of pin judgment assignment
netLed.taskLed(LEDA)

netLed.taskLte(ledPinSetFunc)#

LTE Running Tasks for Indicator Modules

Parameters

None

Return Value

return value type

explanation

nil

No return value

Examples

local LEDA = gpio.setup(27,1,gpio.PULLUP) --LED End of pin judgment assignment
netLed.taskLte(LEDA)

netLed.setup(flag,ledpin,ltepin)#

Configure the network lights and LTE lights and perform the configured actions immediately

Parameters

Incoming Value Type

Explanation

bool

flag Whether to turn on the network indicator and LTE indicator functions, true is on, false is off

number

ledPin The GPIO pin that controls the flashing network indicator, such as pio.P0_1 GPIO1

number

ltePin The GPIO pin that controls the flashing of the LTE indicator, such as pio.P0_4 GPIO4

Return Value

return value type

explanation

nil

No return value

Examples

netLed.setup(true,27,0)

netLed.setBlinkTime(state,on,off)#

Configure the duration of the indicator light on and off in a certain working state (if the user does not configure it, use the default value ledBlinkTime configured in netLed.lua)

Parameters

Incoming Value Type

Explanation

string

state Some kind of working status, only supports”FLYMODE”、”SIMERR”、”IDLE”、”GSM”、”GPRS”、”SCK”

number

on The duration of the indicator light, in milliseconds, 0xFFFF means always on, and 0 means always off

number

off The indicator light is off, in milliseconds, 0xFFFF means always off, 0 means always on

Return Value

return value type

explanation

nil

No return value

Examples

netLed.setBlinkTime(("FLYMODE",1000,500) --Indicates that under the working state of flight mode, the indicator light flashes regularly: on for 1 second and off for 8.5 seconds.

netLed.setupBreateLed(ledPin)#

Breathing light

Parameters

Incoming Value Type

Explanation

function

ledPin LedPin (1) of breathing light is registered with pins.setup to return the method

Return Value

return value type

explanation

nil

No return value

Examples

local netLed = require ("netLed")
local LEDA = gpio.setup(27,1,gpio.PULLUP) --LED End of pin judgment assignment
sys.taskInit(function()
--Breathing light
sys.wait(5080)--Delay 5 seconds waiting for network registration
log.info("mobile.status()", mobile.status())
  while true do
        if mobile.status() == 1 then--Registered
            sys.wait(688)
            netLed.setupBreateLed(LEDA)
        end
   end
end)