1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- // metronik.h :
- //
- /*
- *
- * ACHTUNG:
- * Befindet sich der Sensors am Bus mit anderen Teilnehmern führt ein Pollen der Slaves mit einem Frame-Delay < 10 ms zu Timeout-Problemen des Sensors!
- *
- */
- #if !defined(AGD_METRONIK_H__307066E3_A2D6_4104_A274_BC71B3798327__INCLUDED_)
- #define AGD_METRONIK_H__307066E3_A2D6_4104_A274_BC71B3798327__INCLUDED_
- #include <gfambrtumst.h>
- #ifdef __cplusplus
- extern "C" {
- #endif // __cplusplus
- /////////////////////////////////////////////////////////////////////////////
- // metronik.h - Declarations:
- #define MB_ILM_FUNC_READ_UV ((uint8_t)0x41)
- #define MB_ILM_FUNC_READ_TEMP ((uint8_t)0x42)
- #define MB_ILM_FUNC_UNLOCK ((uint8_t)0x43)
- #define MB_ILM_FUNC_NEW_ADDR ((uint8_t)0x44)
- #define MB_ILM_FUNC_READ_RANGE ((uint8_t)0x45)
- #define MB_ILM_FUNC_READ_SERIAL ((uint8_t)0x46)
- /////////////////////////////////////////////////////////////////////////////
- typedef void (*PFN_READ_UV_COMPLETE) (uint32_t nTID, uint8_t nSlvID, uint16_t err, uint16_t nVal);
- typedef void (*PFN_READ_TEMP_COMPLETE) (uint32_t nTID, uint8_t nSlvID, uint16_t err, uint8_t nVal);
- typedef void (*PFN_READ_UNLOCK_COMPLETE) (uint32_t nTID, uint8_t nSlvID, uint16_t err, uint8_t nVal);
- typedef void (*PFN_NEW_ADDR_COMPLETE) (uint32_t nTID, uint8_t nSlvID, uint16_t err, uint8_t nVal);
- typedef void (*PFN_READ_RANGE_COMPLETE) (uint32_t nTID, uint8_t nSlvID, uint16_t err, uint16_t nVal);
- typedef void (*PFN_READ_SERIAL_COMPLETE) (uint32_t nTID, uint8_t nSlvID, uint16_t err, const uint8_t *pVal, size_t nCbVal);
- /////////////////////////////////////////////////////////////////////////////
- bool ModbusRtuILMReadUV(HMBRTUMST hMbMst, uint32_t nTID, uint8_t nSlvID, PFN_READ_UV_COMPLETE pfnReadUvComplete);
- bool ModbusRtuILMReadTemp(HMBRTUMST hMbMst, uint32_t nTID, uint8_t nSlvID, PFN_READ_TEMP_COMPLETE pfnReadTempComplete);
- bool ModbusRtuILMUnlock(HMBRTUMST hMbMst, uint32_t nTID, uint8_t nSlvID, PFN_READ_UNLOCK_COMPLETE pfnUnlockComplete);
- bool ModbusRtuILMReadRange(HMBRTUMST hMbMst, uint32_t nTID, uint8_t nSlvID, PFN_READ_RANGE_COMPLETE pfnReadRangeComplete);
- bool ModbusRtuILMReadSerial(HMBRTUMST hMbMst, uint32_t nTID, uint8_t nSlvID, PFN_READ_SERIAL_COMPLETE pfnReadSerialComplete);
- /*
- * ModbusRtuILMNewAddr: Weist dem Sensor eine neue Slave-Adresse zu.
- * Achtung: Der Sensor antwortet bei Erfolg bereits mit der neuen Slave-Adresse im Antwort-Frame!!!
- * Der Master ruft im Anschluss die Completion-Funktion mit dem Fehlercode MB_MST_ERROR_INVALID_SLAVE_ID (1) auf!
- * Die neue Slave-Adresse wurde in diesem Fall aber erfolgreich im Slave gesetzt!
- *
- * Achtung: Der Sensor akzeptiert die Broadcast-Adresse 0 als Slave-ID!!!! Diese sollte niemals gesetzt werden!
- */
- bool ModbusRtuILMNewAddr(HMBRTUMST hMbMst, uint32_t nTID, uint8_t nSlvID, uint8_t nNewAddr, PFN_NEW_ADDR_COMPLETE pfnNewAddrComplete);
- /////////////////////////////////////////////////////////////////////////////
- #ifdef __cplusplus
- }
- #endif // __cplusplus
- #endif // !defined(AGD_METRONIK_H__307066E3_A2D6_4104_A274_BC71B3798327__INCLUDED_)
|