Radiocraft Wireless M-Bus extension module
2.18
|
These functions can be called from VPL using the MODCALL keyword. More...
Functions | |
static int32 MODDECL | mbusCallOpen (HANDLE *pCPU, void *pBase) |
Open communication interface to the module. More... | |
static int32 MODDECL | mbusCallClose (HANDLE *pCPU, void *pBase) |
Close communication interface to the module. More... | |
static int32 MODDECL | mbusCallFilterReceive (HANDLE *pCPU, void *pBase) |
Check if any MBUS packets has been received for a given filter. More... | |
static int32 MODDECL | mbusCallReceive (HANDLE *pCPU, void *pBase) |
Check if any MBUS packets has been received. More... | |
static int32 MODDECL | mbusCallSend (HANDLE *pCPU, void *pBase) |
Send a MBUS message. More... | |
static int32 MODDECL | mbusCallInfo (HANDLE *pCPU, void *pBase) |
Perform a series of tests to validate communication. More... | |
static int32 MODDECL | mbusCallFilterEnable (HANDLE *pCPU, void *pBase) |
Set mode. More... | |
static int32 MODDECL | mbusCallRegisterSlave (HANDLE *pCPU, void *pBase) |
Register a slave device. More... | |
static int32 MODDECL | mbusCallGetBufferLevel (HANDLE *pCPU, void *pBase) |
Get the actual level of how full the buffer is in promille. More... | |
These functions can be called from VPL using the MODCALL keyword.
|
static |
Close communication interface to the module.
[in] | pCPU | The handle to the system. |
[in] | pBase | Pointer to structure with function parameters. |
Definition at line 2095 of file mod_mbus.c.
References lock, mbusClose(), mbusDebug(), mbusStopReader(), MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by moduleInit().
|
static |
Set mode.
[in] | pCPU | The handle to the system. |
[in] | pBase | Pointer to structure with function parameters. |
Definition at line 2302 of file mod_mbus.c.
References lock, mbus_config(), mbusClose(), mbusDebug(), mbusOpen(), MUTEX_LOCK, MUTEX_UNLOCK, mbus_set_filter::only_installed, and rssi_included.
Referenced by moduleInit().
|
static |
Check if any MBUS packets has been received for a given filter.
[in] | pCPU | The handle to the system. |
[in] | pBase | pointer to VPL functions data structure |
Definition at line 2123 of file mod_mbus.c.
References mbus_filter_receive::frame, mbus_slave_address::id, mbus_filter_receive::idx, lock, mbus_slave_address::manufacturer, MAX_SLAVE_REGISTERS, mbus_slave_register, mbusBufferReceive(), mbusDebug(), MUTEX_LOCK, MUTEX_UNLOCK, mbus_slave_address::type, and mbus_slave_address::version.
Referenced by moduleInit().
|
static |
Get the actual level of how full the buffer is in promille.
[in] | pCPU | The handle to the system. |
[in] | pBase | Pointer to structure with function parameters. |
Definition at line 2365 of file mod_mbus.c.
References lock, mbusDebug(), mbusGetBufferLevel(), MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by moduleInit().
|
static |
Perform a series of tests to validate communication.
Perform a series of test by reading out configuration values to validate communication to module, result is send to device output.
Prints:
Result
mbus_test:Signal quality = 0 mbus_test:RSSI = 205 (-102 dBm) mbus_test:Temperature = 32 C mbus_test:VCC = 3450mV mbus_test:MBUS_MODE = 0x01 mbus_test:DATA_INTERFACE = 0x00 mbus_test:PART_NUMBER = RC1180-MBUS3 mbus_test:HW_REV_NO = 2.00 mbus_test:FW_REV_NO = 3.15 mbus_info:SERIAL_NUMBER = 01 23 45 67 89 AB CD EF mbus_info:INSTALL_MODE = 0x02 mbus_info:RSSI_MODE = 0x01
[in] | pCPU | The handle to the system. |
[in] | pBase | pointer to VPL functions data structure |
Definition at line 2274 of file mod_mbus.c.
References lock, mbus_info(), mbusClose(), mbusDebug(), mbusOpen(), MUTEX_LOCK, MUTEX_UNLOCK, and rssi_included.
Referenced by moduleInit().
|
static |
Open communication interface to the module.
[in] | pCPU | The handle to the system. |
[in] | pBase | Pointer to structure with function parameters. |
Definition at line 2068 of file mod_mbus.c.
References lock, mbus_open::max_frames, mbusDebug(), mbusOpen(), mbusStartReader(), mbus_open::mode, MUTEX_LOCK, MUTEX_UNLOCK, mbus_open::overwrite, and mbus_open::rssi.
Referenced by moduleInit().
|
static |
Check if any MBUS packets has been received.
[in] | pCPU | The handle to the system. |
[in] | pBase | pointer to VPL functions data structure |
Definition at line 2160 of file mod_mbus.c.
References mbus_receive::frame, mbus_receive::id, mbus_slave_address::id, lock, mbus_receive::manufacturer, mbus_slave_address::manufacturer, mbusBufferReceive(), mbusDebug(), MUTEX_LOCK, MUTEX_UNLOCK, mbus_receive::timeout, mbus_receive::type, mbus_slave_address::type, mbus_receive::version, and mbus_slave_address::version.
Referenced by moduleInit().
|
static |
Register a slave device.
It is stored persistently.
[in] | pCPU | The handle to the system. |
[in] | pBase | Pointer to structure with function parameters. |
Definition at line 2331 of file mod_mbus.c.
References mbus_reg_slave::id, mbus_reg_slave::idx, mbus_reg_slave::key, lock, mbus_reg_slave::manufacturer, mbus_register_slave(), mbusClose(), mbusDebug(), mbusOpen(), MUTEX_LOCK, MUTEX_UNLOCK, rssi_included, mbus_reg_slave::type, and mbus_reg_slave::version.
Referenced by moduleInit().
|
static |
Send a MBUS message.
[in] | pCPU | The handle to the system. |
[in] | pBase | pointer to VPL functions data structure |
Definition at line 2190 of file mod_mbus.c.
References mbus_send::control, mbus_send::data, mbus_send::length, lock, MBUS_DATA_LENGTH, mbusClose(), mbusDebug(), mbusOpen(), mbusSend(), MUTEX_LOCK, MUTEX_UNLOCK, and rssi_included.
Referenced by moduleInit().