SwTimerStart

Definition: This function starts a regular timer and installs the corresponding callback function handling the timeout event.

Syntax

StackRetStatus_t SwTimerStart(uint8_t timerId, uint32_t timerCount,
SwTimeoutType_t timeoutType, void *timerCb, void *paramCb);

Input Parameters

Table 1. Input Parameters

Parameter Name

Parameter Type

Description

timerId

uint8_t

Timer identifier

timerCount

uint32_t

Timeout in microseconds

timeoutType

SwTimeoutType_t

  • SW_TIMEOUT_RELATIVE – The timeout is relative to the current time
  • SW_TIMEOUT_ABSOLUTE – The timeout is an absolute value

timerCb

Void pointer

Callback handler invoked upon timer expiry

paramCb

Void pointer

Argument for the callback handler

Return Type and Values

Table 2. Return Type

Parameters Name

Parameter Type

Description

StackRetStatus_t

ENUM

List of enumerated values for return Status

Table 3. Return Values

Return Value

Reason

LORAWAN_SUCCESS

Timer is started successfully

LORAWAN_INVALID_REQUEST

Timer is already running

LORAWAN_INVALID_PARAMETER

Timer ID, timeout type or timeout value is wrong

API Type – Synchronous