Integrating the ublox LISA C200 modem

Fork of SprintUSBModemHTTPClientTest by Donatien Garnier

Committer:
sam_grove
Date:
Thu Sep 26 00:44:20 2013 -0500
Revision:
5:3f93dd1d4cb3
Exported program and replaced contents of the repo with the source
to build and debug using keil mdk. Libs NOT upto date are lwip, lwip-sys
and socket. these have newer versions under mbed_official but were starting
from a know working point

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sam_grove 5:3f93dd1d4cb3 1 /* mbed Microcontroller Library
sam_grove 5:3f93dd1d4cb3 2 * Copyright (c) 2006-2012 ARM Limited
sam_grove 5:3f93dd1d4cb3 3 *
sam_grove 5:3f93dd1d4cb3 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
sam_grove 5:3f93dd1d4cb3 5 * of this software and associated documentation files (the "Software"), to deal
sam_grove 5:3f93dd1d4cb3 6 * in the Software without restriction, including without limitation the rights
sam_grove 5:3f93dd1d4cb3 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
sam_grove 5:3f93dd1d4cb3 8 * copies of the Software, and to permit persons to whom the Software is
sam_grove 5:3f93dd1d4cb3 9 * furnished to do so, subject to the following conditions:
sam_grove 5:3f93dd1d4cb3 10 *
sam_grove 5:3f93dd1d4cb3 11 * The above copyright notice and this permission notice shall be included in
sam_grove 5:3f93dd1d4cb3 12 * all copies or substantial portions of the Software.
sam_grove 5:3f93dd1d4cb3 13 *
sam_grove 5:3f93dd1d4cb3 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
sam_grove 5:3f93dd1d4cb3 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
sam_grove 5:3f93dd1d4cb3 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
sam_grove 5:3f93dd1d4cb3 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
sam_grove 5:3f93dd1d4cb3 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
sam_grove 5:3f93dd1d4cb3 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
sam_grove 5:3f93dd1d4cb3 20 * SOFTWARE.
sam_grove 5:3f93dd1d4cb3 21 */
sam_grove 5:3f93dd1d4cb3 22 #ifndef THREAD_H
sam_grove 5:3f93dd1d4cb3 23 #define THREAD_H
sam_grove 5:3f93dd1d4cb3 24
sam_grove 5:3f93dd1d4cb3 25 #include <stdint.h>
sam_grove 5:3f93dd1d4cb3 26 #include "cmsis_os.h"
sam_grove 5:3f93dd1d4cb3 27
sam_grove 5:3f93dd1d4cb3 28 namespace rtos {
sam_grove 5:3f93dd1d4cb3 29
sam_grove 5:3f93dd1d4cb3 30 /** The Thread class allow defining, creating, and controlling thread functions in the system. */
sam_grove 5:3f93dd1d4cb3 31 class Thread {
sam_grove 5:3f93dd1d4cb3 32 public:
sam_grove 5:3f93dd1d4cb3 33 /** Create a new thread, and start it executing the specified function.
sam_grove 5:3f93dd1d4cb3 34 @param task function to be executed by this thread.
sam_grove 5:3f93dd1d4cb3 35 @param argument pointer that is passed to the thread function as start argument. (default: NULL).
sam_grove 5:3f93dd1d4cb3 36 @param priority initial priority of the thread function. (default: osPriorityNormal).
sam_grove 5:3f93dd1d4cb3 37 @param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
sam_grove 5:3f93dd1d4cb3 38 @param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
sam_grove 5:3f93dd1d4cb3 39 */
sam_grove 5:3f93dd1d4cb3 40 Thread(void (*task)(void const *argument), void *argument=NULL,
sam_grove 5:3f93dd1d4cb3 41 osPriority priority=osPriorityNormal,
sam_grove 5:3f93dd1d4cb3 42 uint32_t stack_size=DEFAULT_STACK_SIZE,
sam_grove 5:3f93dd1d4cb3 43 unsigned char *stack_pointer=NULL);
sam_grove 5:3f93dd1d4cb3 44
sam_grove 5:3f93dd1d4cb3 45 /** Terminate execution of a thread and remove it from Active Threads
sam_grove 5:3f93dd1d4cb3 46 @return status code that indicates the execution status of the function.
sam_grove 5:3f93dd1d4cb3 47 */
sam_grove 5:3f93dd1d4cb3 48 osStatus terminate();
sam_grove 5:3f93dd1d4cb3 49
sam_grove 5:3f93dd1d4cb3 50 /** Set priority of an active thread
sam_grove 5:3f93dd1d4cb3 51 @param priority new priority value for the thread function.
sam_grove 5:3f93dd1d4cb3 52 @return status code that indicates the execution status of the function.
sam_grove 5:3f93dd1d4cb3 53 */
sam_grove 5:3f93dd1d4cb3 54 osStatus set_priority(osPriority priority);
sam_grove 5:3f93dd1d4cb3 55
sam_grove 5:3f93dd1d4cb3 56 /** Get priority of an active thread
sam_grove 5:3f93dd1d4cb3 57 @return current priority value of the thread function.
sam_grove 5:3f93dd1d4cb3 58 */
sam_grove 5:3f93dd1d4cb3 59 osPriority get_priority();
sam_grove 5:3f93dd1d4cb3 60
sam_grove 5:3f93dd1d4cb3 61 /** Set the specified Signal Flags of an active thread.
sam_grove 5:3f93dd1d4cb3 62 @param signals specifies the signal flags of the thread that should be set.
sam_grove 5:3f93dd1d4cb3 63 @return previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
sam_grove 5:3f93dd1d4cb3 64 */
sam_grove 5:3f93dd1d4cb3 65 int32_t signal_set(int32_t signals);
sam_grove 5:3f93dd1d4cb3 66
sam_grove 5:3f93dd1d4cb3 67 /** State of the Thread */
sam_grove 5:3f93dd1d4cb3 68 enum State {
sam_grove 5:3f93dd1d4cb3 69 Inactive, /**< Not created or terminated */
sam_grove 5:3f93dd1d4cb3 70 Ready, /**< Ready to run */
sam_grove 5:3f93dd1d4cb3 71 Running, /**< Running */
sam_grove 5:3f93dd1d4cb3 72 WaitingDelay, /**< Waiting for a delay to occur */
sam_grove 5:3f93dd1d4cb3 73 WaitingInterval, /**< Waiting for an interval to occur */
sam_grove 5:3f93dd1d4cb3 74 WaitingOr, /**< Waiting for one event in a set to occur */
sam_grove 5:3f93dd1d4cb3 75 WaitingAnd, /**< Waiting for multiple events in a set to occur */
sam_grove 5:3f93dd1d4cb3 76 WaitingSemaphore, /**< Waiting for a semaphore event to occur */
sam_grove 5:3f93dd1d4cb3 77 WaitingMailbox, /**< Waiting for a mailbox event to occur */
sam_grove 5:3f93dd1d4cb3 78 WaitingMutex, /**< Waiting for a mutex event to occur */
sam_grove 5:3f93dd1d4cb3 79 };
sam_grove 5:3f93dd1d4cb3 80
sam_grove 5:3f93dd1d4cb3 81 /** State of this Thread
sam_grove 5:3f93dd1d4cb3 82 @return the State of this Thread
sam_grove 5:3f93dd1d4cb3 83 */
sam_grove 5:3f93dd1d4cb3 84 State get_state();
sam_grove 5:3f93dd1d4cb3 85
sam_grove 5:3f93dd1d4cb3 86 /** Wait for one or more Signal Flags to become signaled for the current RUNNING thread.
sam_grove 5:3f93dd1d4cb3 87 @param signals wait until all specified signal flags set or 0 for any single signal flag.
sam_grove 5:3f93dd1d4cb3 88 @param millisec timeout value or 0 in case of no time-out. (default: osWaitForever).
sam_grove 5:3f93dd1d4cb3 89 @return event flag information or error code.
sam_grove 5:3f93dd1d4cb3 90 */
sam_grove 5:3f93dd1d4cb3 91 static osEvent signal_wait(int32_t signals, uint32_t millisec=osWaitForever);
sam_grove 5:3f93dd1d4cb3 92
sam_grove 5:3f93dd1d4cb3 93 /** Wait for a specified time period in millisec:
sam_grove 5:3f93dd1d4cb3 94 @param millisec time delay value
sam_grove 5:3f93dd1d4cb3 95 @return status code that indicates the execution status of the function.
sam_grove 5:3f93dd1d4cb3 96 */
sam_grove 5:3f93dd1d4cb3 97 static osStatus wait(uint32_t millisec);
sam_grove 5:3f93dd1d4cb3 98
sam_grove 5:3f93dd1d4cb3 99 /** Pass control to next thread that is in state READY.
sam_grove 5:3f93dd1d4cb3 100 @return status code that indicates the execution status of the function.
sam_grove 5:3f93dd1d4cb3 101 */
sam_grove 5:3f93dd1d4cb3 102 static osStatus yield();
sam_grove 5:3f93dd1d4cb3 103
sam_grove 5:3f93dd1d4cb3 104 /** Get the thread id of the current running thread.
sam_grove 5:3f93dd1d4cb3 105 @return thread ID for reference by other functions or NULL in case of error.
sam_grove 5:3f93dd1d4cb3 106 */
sam_grove 5:3f93dd1d4cb3 107 static osThreadId gettid();
sam_grove 5:3f93dd1d4cb3 108
sam_grove 5:3f93dd1d4cb3 109 virtual ~Thread();
sam_grove 5:3f93dd1d4cb3 110
sam_grove 5:3f93dd1d4cb3 111 private:
sam_grove 5:3f93dd1d4cb3 112 osThreadId _tid;
sam_grove 5:3f93dd1d4cb3 113 osThreadDef_t _thread_def;
sam_grove 5:3f93dd1d4cb3 114 bool _dynamic_stack;
sam_grove 5:3f93dd1d4cb3 115 };
sam_grove 5:3f93dd1d4cb3 116
sam_grove 5:3f93dd1d4cb3 117 }
sam_grove 5:3f93dd1d4cb3 118 #endif