Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: libmDot mbed-rtos mbed
Fork of mDot_LoRa_Sensornode by
app/TaskLoRaMeasurement.h@0:f2815503561f, 2016-07-06 (annotated)
- Committer:
- mitea1
- Date:
- Wed Jul 06 20:40:36 2016 +0000
- Revision:
- 0:f2815503561f
initial commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mitea1 | 0:f2815503561f | 1 | /** |
mitea1 | 0:f2815503561f | 2 | * @file TaskLoRaMeasurement.h |
mitea1 | 0:f2815503561f | 3 | * |
mitea1 | 0:f2815503561f | 4 | * @author Adrian |
mitea1 | 0:f2815503561f | 5 | * @date 13.06.2016 |
mitea1 | 0:f2815503561f | 6 | */ |
mitea1 | 0:f2815503561f | 7 | |
mitea1 | 0:f2815503561f | 8 | #include <Thread.h> |
mitea1 | 0:f2815503561f | 9 | #include <Queue.h> |
mitea1 | 0:f2815503561f | 10 | #include <Mutex.h> |
mitea1 | 0:f2815503561f | 11 | #include "LoRa.h" |
mitea1 | 0:f2815503561f | 12 | #include "LoRaMeasuermentMessage.h" |
mitea1 | 0:f2815503561f | 13 | #include "main.h" |
mitea1 | 0:f2815503561f | 14 | |
mitea1 | 0:f2815503561f | 15 | #ifndef APP_TASKLORAMEASUREMENT_H_ |
mitea1 | 0:f2815503561f | 16 | #define APP_TASKLORAMEASUREMENT_H_ |
mitea1 | 0:f2815503561f | 17 | |
mitea1 | 0:f2815503561f | 18 | class TaskLoRaMeasurement { |
mitea1 | 0:f2815503561f | 19 | public: |
mitea1 | 0:f2815503561f | 20 | TaskLoRaMeasurement(LoRa*,Mutex*, Queue<LoRaMeasurementMessage,LORA_MEASUREMENT_QUEUE_LENGHT>*); |
mitea1 | 0:f2815503561f | 21 | TaskLoRaMeasurement(LoRa*,Mutex*,Queue<LoRaMeasurementMessage,LORA_MEASUREMENT_QUEUE_LENGHT>*, |
mitea1 | 0:f2815503561f | 22 | osPriority, uint32_t, unsigned char*); |
mitea1 | 0:f2815503561f | 23 | virtual ~TaskLoRaMeasurement(); |
mitea1 | 0:f2815503561f | 24 | |
mitea1 | 0:f2815503561f | 25 | osStatus start(); |
mitea1 | 0:f2815503561f | 26 | osStatus stop(); |
mitea1 | 0:f2815503561f | 27 | |
mitea1 | 0:f2815503561f | 28 | TASK_STATE getState(); |
mitea1 | 0:f2815503561f | 29 | |
mitea1 | 0:f2815503561f | 30 | private: |
mitea1 | 0:f2815503561f | 31 | rtos::Thread* thread; |
mitea1 | 0:f2815503561f | 32 | rtos::Queue<LoRaMeasurementMessage,LORA_MEASUREMENT_QUEUE_LENGHT>* queue; |
mitea1 | 0:f2815503561f | 33 | rtos::Mutex* mutexLoRa ; |
mitea1 | 0:f2815503561f | 34 | osPriority priority; |
mitea1 | 0:f2815503561f | 35 | uint32_t stack_size; |
mitea1 | 0:f2815503561f | 36 | unsigned char *stack_pointer; |
mitea1 | 0:f2815503561f | 37 | |
mitea1 | 0:f2815503561f | 38 | TASK_STATE state; |
mitea1 | 0:f2815503561f | 39 | |
mitea1 | 0:f2815503561f | 40 | LoRa* lora; |
mitea1 | 0:f2815503561f | 41 | |
mitea1 | 0:f2815503561f | 42 | static void callBack(void const *); |
mitea1 | 0:f2815503561f | 43 | void measureSignal(); |
mitea1 | 0:f2815503561f | 44 | |
mitea1 | 0:f2815503561f | 45 | void setQueue(Queue<LoRaMeasurementMessage,LORA_MEASUREMENT_QUEUE_LENGHT>*); |
mitea1 | 0:f2815503561f | 46 | void setMutex(Mutex*); |
mitea1 | 0:f2815503561f | 47 | void setPriority(osPriority); |
mitea1 | 0:f2815503561f | 48 | void setStackSize(uint32_t); |
mitea1 | 0:f2815503561f | 49 | void setStackPointer(unsigned char*); |
mitea1 | 0:f2815503561f | 50 | |
mitea1 | 0:f2815503561f | 51 | void setState(TASK_STATE); |
mitea1 | 0:f2815503561f | 52 | |
mitea1 | 0:f2815503561f | 53 | }; |
mitea1 | 0:f2815503561f | 54 | |
mitea1 | 0:f2815503561f | 55 | #endif /* APP_TASKLORAMEASUREMENT_H_ */ |