Библиотечные возможности Loconet по перехвату событий:
Код:
extern void notifySensor( uint16_t Address, uint8_t State ) __attribute__ ((weak));
// Address: Switch Address.
// Output: Value 0 for Coil Off, anything else for Coil On
// Direction: Value 0 for Closed/GREEN, anything else for Thrown/RED
extern void notifySwitchRequest( uint16_t Address, uint8_t Output, uint8_t Direction ) __attribute__ ((weak));
extern void notifySwitchReport( uint16_t Address, uint8_t Output, uint8_t Direction ) __attribute__ ((weak));
extern void notifySwitchState( uint16_t Address, uint8_t Output, uint8_t Direction ) __attribute__ ((weak));
extern void notifyPower( uint8_t State ) __attribute__ ((weak));
// Throttle notify Call-back functions
extern void notifyThrottleAddress( uint8_t UserData, TH_STATE State, uint16_t Address, uint8_t Slot ) __attribute__ ((weak));
extern void notifyThrottleSpeed( uint8_t UserData, TH_STATE State, uint8_t Speed ) __attribute__ ((weak));
extern void notifyThrottleDirection( uint8_t UserData, TH_STATE State, uint8_t Direction ) __attribute__ ((weak));
extern void notifyThrottleFunction( uint8_t UserData, uint8_t Function, uint8_t Value ) __attribute__ ((weak));
extern void notifyThrottleSlotStatus( uint8_t UserData, uint8_t Status ) __attribute__ ((weak));
extern void notifyThrottleError( uint8_t UserData, TH_ERROR Error ) __attribute__ ((weak));
extern void notifyThrottleState( uint8_t UserData, TH_STATE PrevState, TH_STATE State ) __attribute__ ((weak));
// FastClock notify Call-back functions
extern void notifyFastClock( uint8_t Rate, uint8_t Day, uint8_t Hour, uint8_t Minute, uint8_t Sync ) __attribute__ ((weak));
extern void notifyFastClockFracMins( uint16_t FracMins ) __attribute__ ((weak));
// System Variable notify Call-back functions
extern void notifySVChanged(uint16_t Offset) __attribute__ ((weak));
Библиотечные возможности Loconet по отправке событий:
Код:
LN_STATUS requestSwitch( uint16_t Address, uint8_t Output, uint8_t Direction ) ;
LN_STATUS reportSwitch( uint16_t Address ) ;
LN_STATUS reportSensor( uint16_t Address, uint8_t State ) ;
LN_STATUS reportPower( uint8_t State ) ;