mbgtools-lx  4.2.8
Meinberg LED API definitions

Data Structures

struct  MBG_LED_LIMITS
 General LED info to be read from a device. More...
 
struct  MBG_LED_SETTINGS
 Configuration settings for a single LED. More...
 
struct  MBG_LED_SETTINGS_IDX
 Configuration settings for a single LED, plus index. More...
 
struct  MBG_LED_INFO
 Current settings and general capabilities of an LED. More...
 
struct  MBG_LED_INFO_IDX
 Current settings and general capabilities of an LED, plus index. More...
 

Macros

#define _mbg_swab_mbg_led_limits(_p)
 
#define MBG_LED_MODE_STRS
 Names of LED modes. More...
 
#define MBG_LED_COLOR_STRS
 Names of LED colors. More...
 
#define _mbg_swab_mbg_led_settings(_p)
 
#define _mbg_swab_mbg_led_settings_idx(_p)
 
#define _mbg_swab_mbg_led_info(_p)
 
#define _mbg_swab_mbg_led_info_idx(_p)
 

Enumerations

enum  MBG_LED_MODES {
  MBG_LED_MODE_OFF, MBG_LED_MODE_ON, MBG_LED_MODE_FLASH, MBG_LED_MODE_FLASH_5S,
  N_MBG_LED_MODES
}
 Possible modes of LEDs. More...
 
enum  MBG_LED_MODE_MASKS { MBG_LED_MODE_MASK_OFF = ( 1UL << MBG_LED_MODE_OFF ), MBG_LED_MODE_MASK_ON = ( 1UL << MBG_LED_MODE_ON ), MBG_LED_MODE_MASK_FLASH = ( 1UL << MBG_LED_MODE_FLASH ), MBG_LED_MODE_MASK_FLASH_5S = ( 1UL << MBG_LED_MODE_FLASH_5S ) }
 Bit masks associated with LED modes. More...
 
enum  MBG_LED_COLORS {
  MBG_LED_COLOR_GREEN, MBG_LED_COLOR_RED, MBG_LED_COLOR_YELLOW, MBG_LED_COLOR_BLUE,
  N_MBG_LED_COLORS
}
 Possible colors of LEDs. More...
 
enum  MBG_LED_COLOR_MASKS { MBG_LED_COLOR_MASK_GREEN = ( 1UL << MBG_LED_COLOR_GREEN ), MBG_LED_COLOR_MASK_RED = ( 1UL << MBG_LED_COLOR_RED ), MBG_LED_COLOR_MASK_YELLOW = ( 1UL << MBG_LED_COLOR_YELLOW ), MBG_LED_COLOR_MASK_BLUE = ( 1UL << MBG_LED_COLOR_BLUE ) }
 Bit masks of possible LED colors. More...
 

Functions

int mbgextio_get_led_limits (MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_LED_LIMITS *p)
 Read the MBG_LED_LIMITS to check how many LEDs are provided. More...
 
int mbgextio_get_led_info_idx (MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_LED_INFO_IDX *p, uint16_t idx)
 Read the current settings and features of a particular LED. More...
 
int mbgextio_get_led_settings_idx (MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_LED_SETTINGS_IDX *p, uint16_t idx)
 Read a MBG_LED_SETTINGS_IDX parameter structure from a device. More...
 
int mbgextio_set_led_settings_idx (MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_LED_SETTINGS *p, uint16_t idx)
 Write a MBG_LED_SETTINGS parameter structure to a device. More...
 

Detailed Description

Note
These structures and definitions are only supported by a device if MBG_XFEATURE_LED_API is set in the extended device features.

Macro Definition Documentation

◆ _mbg_swab_mbg_led_info

#define _mbg_swab_mbg_led_info (   _p)
Value:
do \
{ \
_mbg_swab_mbg_led_settings( &(_p)->settings ); \
_mbg_swab32( &(_p)->supp_modes ); \
_mbg_swab32( &(_p)->supp_colors ); \
_mbg_swab32( &(_p)->reserved ); \
_mbg_swab32( &(_p)->flags ); \
} while ( 0 )

Definition at line 18918 of file gpsdefs.h.

◆ _mbg_swab_mbg_led_info_idx

#define _mbg_swab_mbg_led_info_idx (   _p)
Value:
do \
{ \
_mbg_swab16( &(_p)->idx ); \
_mbg_swab_mbg_led_info( &(_p)->info ); \
} while ( 0 )

Definition at line 18943 of file gpsdefs.h.

Referenced by mbgextio_get_led_info_idx().

◆ _mbg_swab_mbg_led_limits

#define _mbg_swab_mbg_led_limits (   _p)
Value:
do \
{ \
_mbg_swab8( &(_p)->num_leds ); \
_mbg_swab8( &(_p)->reserved_0 ); \
_mbg_swab16( &(_p)->reserved_1 ); \
_mbg_swab32( &(_p)->reserved_2 ); \
} while ( 0 )

Definition at line 18736 of file gpsdefs.h.

Referenced by mbgextio_get_led_limits().

◆ _mbg_swab_mbg_led_settings

#define _mbg_swab_mbg_led_settings (   _p)
Value:
do \
{ \
_mbg_swab8( &(_p)->mode ); \
_mbg_swab8( &(_p)->color ); \
_mbg_swab16( &(_p)->reserved ); \
} while ( 0 )
int mode
Definition: ntp_shm.h:65

Definition at line 18867 of file gpsdefs.h.

◆ _mbg_swab_mbg_led_settings_idx

#define _mbg_swab_mbg_led_settings_idx (   _p)
Value:
do \
{ \
_mbg_swab16( &(_p)->idx ); \
_mbg_swab_mbg_led_settings( &(_p)->settings ); \
} while ( 0 )

Definition at line 18890 of file gpsdefs.h.

Referenced by mbgextio_get_led_settings_idx(), and mbgextio_set_led_settings_idx().

◆ MBG_LED_COLOR_STRS

#define MBG_LED_COLOR_STRS
Value:
{ \
"Green", \
"Red", \
"Yellow", \
"Blue" \
}

Names of LED colors.

Can be used to initialize a string array of N_MBG_LED_COLORS entries, so the number of strings must correspond to N_MBG_LED_COLORS.

See also
MBG_LED_COLORS
MBG_LED_COLOR_MASKS

Definition at line 18844 of file gpsdefs.h.

◆ MBG_LED_MODE_STRS

#define MBG_LED_MODE_STRS
Value:
{ \
"Off", \
"On", \
"Flash", \
"Flash 5s" \
}

Names of LED modes.

Can be used to initialize a string array of N_MBG_LED_MODES entries, so the number of strings must correspond to N_MBG_LED_MODES.

See also
MBG_LED_MODES
MBG_LED_MODE_MASKS

Definition at line 18790 of file gpsdefs.h.

Enumeration Type Documentation

◆ MBG_LED_COLOR_MASKS

Bit masks of possible LED colors.

Used with MBG_LED_INFO::supp_colors

See also
MBG_LED_COLORS
Enumerator
MBG_LED_COLOR_MASK_GREEN 

see MBG_LED_COLOR_GREEN

MBG_LED_COLOR_MASK_RED 

see MBG_LED_COLOR_RED

MBG_LED_COLOR_MASK_YELLOW 

see MBG_LED_COLOR_YELLOW

MBG_LED_COLOR_MASK_BLUE 

see MBG_LED_COLOR_BLUE

Definition at line 18825 of file gpsdefs.h.

◆ MBG_LED_COLORS

Possible colors of LEDs.

Used with MBG_LED_SETTINGS::color

See also
MBG_LED_COLOR_MASKS
Enumerator
MBG_LED_COLOR_GREEN 
MBG_LED_COLOR_RED 
MBG_LED_COLOR_YELLOW 
MBG_LED_COLOR_BLUE 
N_MBG_LED_COLORS 

Definition at line 18807 of file gpsdefs.h.

◆ MBG_LED_MODE_MASKS

Bit masks associated with LED modes.

Used with MBG_LED_INFO::supp_modes

See also
MBG_LED_MODES
Enumerator
MBG_LED_MODE_MASK_OFF 

see MBG_LED_MODE_OFF

MBG_LED_MODE_MASK_ON 

see MBG_LED_MODE_ON

MBG_LED_MODE_MASK_FLASH 

see MBG_LED_MODE_FLASH

MBG_LED_MODE_MASK_FLASH_5S 

see MBG_LED_MODE_FLASH_5S

Definition at line 18772 of file gpsdefs.h.

◆ MBG_LED_MODES

Possible modes of LEDs.

Used with MBG_LED_SETTINGS::mode

See also
MBG_LED_MODE_MASKS
Enumerator
MBG_LED_MODE_OFF 
MBG_LED_MODE_ON 
MBG_LED_MODE_FLASH 
MBG_LED_MODE_FLASH_5S 
N_MBG_LED_MODES 

Definition at line 18754 of file gpsdefs.h.

Function Documentation

◆ mbgextio_get_led_info_idx()

int mbgextio_get_led_info_idx ( MBG_MSG_CTL pmctl,
const XBP_ADDR p_addr,
MBG_LED_INFO_IDX p,
uint16_t  idx 
)

Read the current settings and features of a particular LED.

mbgextio_dev_has_led_api should be used to check if this is supported

Parameters
[in,out]pmctlPointer to a valid message control structure
[in]p_addrPointer to an XBP address specifier, or NULL
[out]pPointer to the data structure to return the received data
[in]idxIndex of the array element to be retrieved, 0..MBG_LED_LIMITS::num_leds-1
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_dev_has_led_api
mbgextio_get_led_limits
mbgextio_get_led_settings_idx
mbgextio_set_led_settings_idx
Meinberg LED API definitions

Definition at line 13745 of file mbgextio.c.

References _mbg_swab_mbg_led_info_idx, GPS_LED_INFO_IDX, mbg_rc_is_success, and mbgextio_req_data_idx().

◆ mbgextio_get_led_limits()

int mbgextio_get_led_limits ( MBG_MSG_CTL pmctl,
const XBP_ADDR p_addr,
MBG_LED_LIMITS p 
)

Read the MBG_LED_LIMITS to check how many LEDs are provided.

mbgextio_dev_has_led_api should be used to check if this is supported

Note
Only supported if MBG_IMS_STATE_FLAG_BIT_HAS_FDM is set in MBG_IMS_STATE::flags
Parameters
[in,out]pmctlPointer to a valid message control structure
[in]p_addrPointer to an XBP address specifier, or NULL
[out]pPointer to the data structure to return the received data
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_dev_has_led_api
mbgextio_get_led_limits
mbgextio_get_led_info_idx
mbgextio_get_led_settings_idx
mbgextio_set_led_settings_idx
Meinberg LED API definitions

Definition at line 13711 of file mbgextio.c.

References _mbg_swab_mbg_led_limits, GPS_LED_LIMITS, mbg_rc_is_success, and mbgextio_req_data().

◆ mbgextio_get_led_settings_idx()

int mbgextio_get_led_settings_idx ( MBG_MSG_CTL pmctl,
const XBP_ADDR p_addr,
MBG_LED_SETTINGS_IDX p,
uint16_t  idx 
)

Read a MBG_LED_SETTINGS_IDX parameter structure from a device.

mbgextio_dev_has_led_api should be used to check if this is supported

Parameters
[in,out]pmctlPointer to a valid message control structure
[in]p_addrPointer to an XBP address specifier, or NULL
[out]pPointer to the data structure to return the received data
[in]idxIndex of the array element to be retrieved, 0..MBG_LED_LIMITS::num_leds-1
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_dev_has_led_api
mbgextio_get_led_limits
mbgextio_get_led_info_idx
mbgextio_set_led_settings_idx
Meinberg LED API definitions

Definition at line 13779 of file mbgextio.c.

References _mbg_swab_mbg_led_settings_idx, GPS_LED_SETTINGS_IDX, mbg_rc_is_success, and mbgextio_req_data_idx().

◆ mbgextio_set_led_settings_idx()

int mbgextio_set_led_settings_idx ( MBG_MSG_CTL pmctl,
const XBP_ADDR p_addr,
const MBG_LED_SETTINGS p,
uint16_t  idx 
)

Write a MBG_LED_SETTINGS parameter structure to a device.

mbgextio_dev_has_led_api should be used to check if this is supported

Parameters
[in,out]pmctlPointer to a valid message control structure
[in]p_addrPointer to an XBP address specifier, or NULL
[in]pPointer to the data structure to be sent to the device
[in]idxIndex of the array element to be set, 0..MBG_LNE_LIMITS::num_ports-1
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_dev_has_led_api
mbgextio_get_led_limits
mbgextio_get_led_info_idx
mbgextio_get_led_settings_idx
Meinberg LED API definitions

Definition at line 13812 of file mbgextio.c.

References _mbg_mutex_acquire, _mbg_swab_mbg_led_settings_idx, MBG_MSG_CTL_s::dev_mutex, GPS_LED_SETTINGS_IDX, MBG_LED_SETTINGS_IDX::idx, MSG_DATA::led_settings_idx, mbgextio_xmt_msg(), MBG_MSG_BUFF::msg_data, OPT_GPS_ACK_CODE, MBG_MSG_XMT_CTL::pmb, MBG_LED_SETTINGS_IDX::settings, MBG_MSG_BUFF::u, and MBG_MSG_CTL_s::xmt.