Early version MultiTech mDot library
Fork of libmDot by
mDotEvent.h@15:6dcef28f37fe, 2017-08-31 (annotated)
- Committer:
- isabelv
- Date:
- Thu Aug 31 07:47:40 2017 +0000
- Revision:
- 15:6dcef28f37fe
- Parent:
- 13:0f89ec319c18
Alcom Potmeterdemo (voor MTUDK-ST-MDOT); Leest waarde potmeter met behulp van ADC uit (aangesloten op D10) en verstuurt waarde via LoRa. LED3 toggled als nieuwe waarde gemeten en verstuurd wordt.;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Mike Fiore |
13:0f89ec319c18 | 1 | #include "LoRaMacEvent.h" |
Mike Fiore |
13:0f89ec319c18 | 2 | #include "MTSLog.h" |
Mike Fiore |
13:0f89ec319c18 | 3 | |
Mike Fiore |
13:0f89ec319c18 | 4 | class mDotEvent : public LoRaMacEvent { |
Mike Fiore |
13:0f89ec319c18 | 5 | public: |
Mike Fiore |
13:0f89ec319c18 | 6 | |
Mike Fiore |
13:0f89ec319c18 | 7 | virtual ~mDotEvent() {} |
Mike Fiore |
13:0f89ec319c18 | 8 | |
Mike Fiore |
13:0f89ec319c18 | 9 | /*! |
Mike Fiore |
13:0f89ec319c18 | 10 | * MAC layer event callback prototype. |
Mike Fiore |
13:0f89ec319c18 | 11 | * |
Mike Fiore |
13:0f89ec319c18 | 12 | * \param [IN] flags Bit field indicating the MAC events occurred |
Mike Fiore |
13:0f89ec319c18 | 13 | * \param [IN] info Details about MAC events occurred |
Mike Fiore |
13:0f89ec319c18 | 14 | */ |
Mike Fiore |
13:0f89ec319c18 | 15 | virtual void MacEvent(LoRaMacEventFlags *flags, LoRaMacEventInfo *info) { |
Mike Fiore |
13:0f89ec319c18 | 16 | logDebug("mDotEvent"); |
Mike Fiore |
13:0f89ec319c18 | 17 | |
Mike Fiore |
13:0f89ec319c18 | 18 | if (flags->Bits.Rx) { |
Mike Fiore |
13:0f89ec319c18 | 19 | logDebug("Rx"); |
Mike Fiore |
13:0f89ec319c18 | 20 | |
Mike Fiore |
13:0f89ec319c18 | 21 | // Event Object must delete RxBuffer |
Mike Fiore |
13:0f89ec319c18 | 22 | delete[] info->RxBuffer; |
Mike Fiore |
13:0f89ec319c18 | 23 | } |
Mike Fiore |
13:0f89ec319c18 | 24 | } |
Mike Fiore |
13:0f89ec319c18 | 25 | |
Mike Fiore |
13:0f89ec319c18 | 26 | virtual uint8_t MeasureBattery(void) { |
Mike Fiore |
13:0f89ec319c18 | 27 | return 255; |
Mike Fiore |
13:0f89ec319c18 | 28 | } |
Mike Fiore |
13:0f89ec319c18 | 29 | }; |