Core Base Classes for the Light Endpoints
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more
Transport.cpp@135:7f3f963cd159, 2014-03-28 (annotated)
- Committer:
- ansond
- Date:
- Fri Mar 28 17:49:10 2014 +0000
- Revision:
- 135:7f3f963cd159
- Parent:
- 37:1588ba3af6d1
- Child:
- 192:54b758a8eaaa
updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ansond | 0:4c9bfcb3e759 | 1 | /* Copyright C2013 Doug Anson, MIT License |
ansond | 0:4c9bfcb3e759 | 2 | * |
ansond | 0:4c9bfcb3e759 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
ansond | 0:4c9bfcb3e759 | 4 | * and associated documentation files the "Software", to deal in the Software without restriction, |
ansond | 0:4c9bfcb3e759 | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
ansond | 0:4c9bfcb3e759 | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
ansond | 0:4c9bfcb3e759 | 7 | * furnished to do so, subject to the following conditions: |
ansond | 0:4c9bfcb3e759 | 8 | * |
ansond | 0:4c9bfcb3e759 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
ansond | 0:4c9bfcb3e759 | 10 | * substantial portions of the Software. |
ansond | 0:4c9bfcb3e759 | 11 | * |
ansond | 0:4c9bfcb3e759 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
ansond | 0:4c9bfcb3e759 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
ansond | 0:4c9bfcb3e759 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
ansond | 0:4c9bfcb3e759 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ansond | 0:4c9bfcb3e759 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
ansond | 0:4c9bfcb3e759 | 17 | */ |
ansond | 0:4c9bfcb3e759 | 18 | |
ansond | 0:4c9bfcb3e759 | 19 | #include "Transport.h" |
ansond | 0:4c9bfcb3e759 | 20 | |
ansond | 0:4c9bfcb3e759 | 21 | // default constructor |
ansond | 135:7f3f963cd159 | 22 | Transport::Transport(ErrorHandler *error_handler,void *endpoint) : BaseClass(error_handler,endpoint) { |
ansond | 0:4c9bfcb3e759 | 23 | this->m_connected = false; |
ansond | 0:4c9bfcb3e759 | 24 | } |
ansond | 0:4c9bfcb3e759 | 25 | |
ansond | 0:4c9bfcb3e759 | 26 | // default destructor |
ansond | 0:4c9bfcb3e759 | 27 | Transport::~Transport() { |
ansond | 0:4c9bfcb3e759 | 28 | } |
ansond | 0:4c9bfcb3e759 | 29 | |
ansond | 0:4c9bfcb3e759 | 30 | // check transport and process stuff |
ansond | 0:4c9bfcb3e759 | 31 | void Transport::checkAndProcess() { |
ansond | 0:4c9bfcb3e759 | 32 | // default is no action |
ansond | 0:4c9bfcb3e759 | 33 | ; |
ansond | 0:4c9bfcb3e759 | 34 | } |
ansond | 20:f2dbbd852e08 | 35 | |
ansond | 22:f337db5c8f6e | 36 | // load the endpoint (base class does nothing) |
ansond | 23:645790d6a2f0 | 37 | bool Transport::loadEndpoint(char *data,int data_length,char *result,int result_length) { return false; } |
ansond | 22:f337db5c8f6e | 38 | |
ansond | 22:f337db5c8f6e | 39 | // update the endpoing (base class does nothing) |
ansond | 37:1588ba3af6d1 | 40 | bool Transport::updateEndpoint(int ioc_id,char *data,int data_length,char *result,int result_length) { return false; } |
ansond | 37:1588ba3af6d1 | 41 | |
ansond | 37:1588ba3af6d1 | 42 | // connect |
ansond | 37:1588ba3af6d1 | 43 | bool Transport::connect() { return this->m_connected; } |
ansond | 37:1588ba3af6d1 | 44 | |
ansond | 37:1588ba3af6d1 | 45 | // disconnect |
ansond | 37:1588ba3af6d1 | 46 | bool Transport::disconnect() { return true; } |