MurataTypeYD_RPC_Sample fixed version for 050314
Dependencies: PowerControl SNICInterface_mod2 mbed-rtos mbed
Fork of HTTPClient_WiFi_HelloWorld by
Revision 6:6c49fdc29825, committed 2015-03-12
- Comitter:
- komoritan
- Date:
- Thu Mar 12 12:27:31 2015 +0000
- Parent:
- 5:3dbedd084f79
- Commit message:
- Fixed
Changed in this revision
--- a/HTTPClient.lib Sat Jan 31 13:49:47 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://developer.mbed.org/users/MACRUM/code/HTTPClient/#3c7789c521df
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HTTPServer.cpp Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,159 @@ +#include "HTTPServer.h" +#include "mbed.h" + + +bool cmp(char* a, char* b) +{ + return strcmp(a,b) < 0; +} + + +HTTPServer::HTTPServer(): +handlers(&cmp), +reply() +{ +} + + +HTTPServer::~HTTPServer() +{ +} + + +bool HTTPServer::init(int port) +{ + DigitalOut led4(LED4); + + socketserver.set_blocking(true); + if(socketserver.bind(port)) + { + printf("Could not bind on port %d.\n", port); + return false; + } + + if(socketserver.listen()) + { + printf("Could not listen %d.\n", port); + return false; + } + + led4 = 1; // server is ready + + return true; +} + + +void HTTPServer::run() +{ + char buffer[1024]; + TCPSocketConnection c; + + while(true) + { +// KTEC MOD START + // SNICInterface_modとNySNICInterfaceのIF差分が存在するため、変更 + //while(socketserver.accept(&c)); + while(socketserver.accept(c)); +// KTEC MOD END + c.set_blocking(false, 1000); + + while(c.is_connected()) + { + int n = c.receive(buffer, sizeof(buffer)-1); + if(n == 0) + { + c.close(); + break; + } + else if(n != -1) + { + buffer[n] = '\0'; + printf("Received data -- %s --. \r\n", buffer); + handle_request(buffer); + create_response(buffer); + printf("Sending data -- %s --. \r\n", buffer); + c.send_all(buffer, strlen(buffer)); + printf("done. \r\n"); + c.close(); + break; + } + else { + printf("Error while receiving data. \r\n"); + c.close(); + break; + } + } + } +} + + +void HTTPServer::handle_request(char *buffer) +{ + char* request_type = strtok(buffer, " "); + char* request = strtok(NULL, " "); + + reply[0] = '\0'; + response_code = HTTP_404_NOTFOUND; + + if(!object.decode(request, reply)){ +// KTEC MOD START + // レスポンスコードを設定 + response_code = HTTP_200_OK; + return; + } else { + response_code = HTTP_400_BADREQUEST; + return; + } +// KTEC MOD END + +// KTEC DEL START +/* + std::map<char*, RequestHandler*>::iterator itor = handlers.find(request_type); + if(itor == handlers.end()) + { + printf("No request handler found for this type of request.\r\n"); + return; + } + if(itor->second != NULL) + response_code = itor->second->handle(object, reply); + else + printf("Invalid request handler\r\n"); +*/ +// KTEC DEL END +} + +void HTTPServer::create_response(char *buffer) +{ + char content_length[30] = ""; + buffer[0] = '\0'; + + /* HTTP Status Code */ + strcat(buffer, "HTTP/1.1 "); + switch(response_code){ + case HTTP_200_OK: + strcat(buffer, "200 OK\r\n"); + break; + case HTTP_404_NOTFOUND: + strcat(buffer, "404 Not Found\r\n"); + break; + default: + strcat(buffer, "500 Internal Server Error\r\n"); + break; + } + + /* add header */ + strcat(buffer, "Access-Control-Allow-Origin: *\r\n"); + sprintf(content_length, "Content-Length: %d\r\n", strlen(reply)); + strncat(buffer, content_length, strlen(content_length)); + strcat(buffer, "Content-Type: text/plain\r\n\r\n"); + + /* add content */ + strcat(buffer, reply); +} + + +void HTTPServer::add_request_handler(char *name, RequestHandler* handler) +{ + handlers[name] = handler; + printf("%s request hander.\r\n", name); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HTTPServer.h Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,42 @@ +#ifndef HTTP_SERVER +#define HTTP_SERVER + +#include <map> +#include "mbed.h" +#include "SNIC_WifiInterface.h" +#include "TCPSocketServer.h" +#include "TCPSocketConnection.h" +#include "RequestHandler.h" +#include "RPCObject.h" + +#define HTTP_REPLY_MAX_STRING 1024 + +enum +{ + HTTP_200_OK = 200, + HTTP_400_BADREQUEST = 400, + HTTP_404_NOTFOUND = 404 +}; + + +class HTTPServer +{ + public : + HTTPServer(); + virtual ~HTTPServer(); + bool init(int port); + void run(); + void add_request_handler(char *name, RequestHandler* handler); + + private : + void handle_request(char* buffer); + void create_response(char* buffer); + TCPSocketServer socketserver; + std::map<char*, RequestHandler*, bool(*)(char*, char*)> handlers; + RPCObject object; + char reply[HTTP_REPLY_MAX_STRING]; + int response_code; +}; + +#endif +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RPCObject.cpp Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,82 @@ +#include "RPCObject.h" +#include "parse_pins.h" +#include "mbed.h" +#include "HTTPServer.h" +// KTEC ADD START +#include "RPC_Function.h" +// KTEC ADD END + +RPCObject::RPCObject() +{ +} + + +int RPCObject::decode(char* request, char* reply) +{ +// KTEC MOD START + // 以下のようなURLで接続された場合は、関数を実行する + // http://ipアドレス/rpc/setLed/1,0,1,1 LED1~4の点灯、消灯 + // http://ipアドレス/rpc/getGyro/ ジャイロ情報の取得 + char* rpc = strtok(request+1,"/"); + char* method = strtok(NULL, "/"); + char* param = strtok(NULL, "/"); + DEBUG_PRINT("decode rpc = %s\r\n", rpc); + DEBUG_PRINT("decode method = %s\r\n", method); + DEBUG_PRINT("decode param = %s\r\n", param); + + if (strcmp(rpc, "rpc") == 0) { + // LEDの点灯、消灯処理実行 + if (strcmp(method, "setLed") == 0) { + DEBUG_PRINT("decode call doSetLed \r\n"); + doSetLed(param, reply); + // ジャイロセンサーの値の取得処理実行 + } else if (strcmp(method, "getGyro") == 0) { + DEBUG_PRINT("decode call doGetGyro \r\n"); + doGetGyro(param, reply); + } else { + DEBUG_PRINT("decode Unsupported method = %s\r\n", method); + return -1; + } + } else { + DEBUG_PRINT("decode rpc does not exist in URL, rpc = %s \r\n", rpc); + return -1; + } +// KTEC MOD END + + return 0; +} + + +bool RPCObject::create_pin_object(char* reply) +{ + RPCClass* pinobj; + + if(pinObjects.find(pin_name) != pinObjects.end()){ + printf("The pin already exists.\r\n"); + strcat(reply, "The pin already exists. "); + return false; + } + + switch(type){ + case RPC_PIN_DIGITAL_IN: + printf("DigitalIn.\r\n"); + pinobj = new RPCDigitalIn(pin_name); + break; + case RPC_PIN_DIGITAL_OUT: + printf("DigitalOut.\r\n"); + pinobj = new RPCDigitalOut(pin_name); + break; + case RPC_PIN_DIGITAL_INOUT: + printf("DigitalInOut.\r\n"); + pinobj = new RPCDigitalInOut(pin_name); + break; + default: + printf(" Unsupported type.\r\n"); + strcat(reply, "Unsupported type. "); + return false; + } + + pinObjects[pin_name] = pinobj; + + return true; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RPCObject.h Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,79 @@ +#ifndef RPCOBJECT +#define RPCOBJECT + +#include <map> +#include "mbed.h" + +enum RPC_PIN_TYPE { + RPC_PIN_DIGITAL_IN, + RPC_PIN_DIGITAL_OUT, + RPC_PIN_DIGITAL_INOUT, + RPC_PIN_UNKNOWN +}; + +struct rpc_arg +{ + char *name; + char *val; +}; + +class RPCClass +{ + public : + virtual int read()= 0; + virtual void write(int value) = 0; +}; + +class RPCDigitalIn : public RPCClass +{ + public : + RPCDigitalIn(PinName pin) :i(pin){} + virtual int read(void){return i.read();} + virtual void write(int value){} + + private : + DigitalIn i; +}; + +class RPCDigitalOut : public RPCClass +{ + public : + RPCDigitalOut(PinName pin) :o(pin){} + virtual int read(void){return o.read();} + virtual void write(int value){o.write(value);} + + private : + DigitalOut o; +}; + +class RPCDigitalInOut : public RPCClass +{ + public : + RPCDigitalInOut(PinName pin) :o(pin){} + virtual int read(void){return o.read();} + virtual void write(int value){o.write(value);} + + private : + DigitalInOut o; +}; + +class RPCObject +{ + public : + RPCObject(); + int decode(char *request, char* reply); + + RPC_PIN_TYPE get_type() const { return type; } + PinName get_pin_name() const { return pin_name; } + int get_value() const { return value; } + bool create_pin_object(char* reply); + std::map<PinName, RPCClass*> pinObjects; + + private : + RPC_PIN_TYPE type; + char obj_name[20]; + PinName pin_name; + int value; +}; +#endif +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RPC_Function.cpp Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,92 @@ +/* Copyright (C) 2015 KDDI Technology, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "mbed.h" +#include "SNIC_WifiInterface.h" +#include "RPC_Function.h" + +// LED設定 +DigitalOut led1(LED1); +DigitalOut led2(LED2); +DigitalOut led3(LED3); +DigitalOut led4(LED4); + +// ジャイロセンサー設定 +AnalogIn gyro1_adc(p16); +AnalogIn gyro2_adc(p17); + +// Led1~4の点灯・消灯処理 +// サンプルとしてLEDの点灯、消灯処理を追加しています +void doSetLed(char* input, char* output) { + + char *tok; + char s2[] = ","; // カンマで区切られていることを想定 + int cnt = 1; + + DEBUG_PRINT("doSetLed IN input = %s, output = %s\r\n", input, output); + + tok = strtok( input, "," ); + + // カンマ区切りの文字列を取得し、1:LED点灯、0(1以外):消灯とする + while( tok != NULL ){ + int ret; + int setled = 0; + ret = strcmp( tok, "1" ); + if (ret == 0) { + setled = 1; + } else { + setled = 0; + } + switch (cnt) { + case 1: + led1 = setled; + break; + case 2: + led2 = setled; + break; + case 3: + led3 = setled; + break; + case 4: + led4 = setled; + break; + default: + break; + } + cnt++; + tok = strtok( NULL, s2 ); // 2回目以降 + } + + // outputにJSON形式で処理結果を返す + sprintf(output, "{\"led1\":%d, \"led2\":%d, \"led3\":%d, \"led4\":%d}",(int)led1, (int)led2, (int)led3, (int)led4); +} + +// ジャイロセンサーの値の取得、返却処理 +// サンプルとしてジャイロセンサーの値の取得、返却処理を追加しています +void doGetGyro(char* input, char* output) { + float gy1_data; + float gy2_data; + + // ジャイロ1,2データの読み込み + gy1_data=gyro1_adc.read(); + gy2_data=gyro2_adc.read(); + + // outputにJSON形式で処理結果を返す + sprintf(output, "Gyro1:%2.5f, Gyro2:%2.5f",gy1_data ,gy2_data); + DEBUG_PRINT("doGetGyro output = %s\r\n",output); +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RPC_Function.h Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,27 @@ +/* Copyright (C) 2015 KDDI Technology, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef RPC_FUNCTION +#define RPC_FUNCTION + +// inputデータに従い、LED1~4の点灯・消灯を設定する。inputデータはカンマ区切りを想定。 +void doSetLed(char* input, char* output); +// ジャイロ情報を取得する。 +void doGetGyro(char* input, char* output); + +#endif \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RequestHandler.cpp Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,86 @@ +#include "mbed.h" +#include "RequestHandler.h" +#include "RPCObject.h" +#include "HTTPServer.h" + + +int GetRequestHandler::handle(RPCObject& cmd, char* reply) +{ + int value; + std::map<PinName, RPCClass*>::iterator itor; + + printf("handling GET request.\r\n"); + itor = cmd.pinObjects.find(cmd.get_pin_name()); + if(itor == cmd.pinObjects.end()){ + printf("The pin is not created.\r\n"); + return HTTP_404_NOTFOUND; + } + value = itor->second->read(); + + reply[0] = '0' + value; + reply[1] = '\0'; + + return HTTP_200_OK; +} + + +int PostRequestHandler::handle(RPCObject& cmd, char* reply) +{ + int value = cmd.get_value(); + std::map<PinName, RPCClass*>::iterator itor; + + printf("handling POST request.\r\n"); + switch(value){ + case 0: + case 1: + //update + printf("now updating the object to %d.\r\n", value); + itor = cmd.pinObjects.find(cmd.get_pin_name()); + if(itor == cmd.pinObjects.end()){ + printf("The pin is not created.\r\n"); + return HTTP_404_NOTFOUND; + } + itor->second->write(value); + break; + case -1: + //create + printf("now createing the object.\r\n"); + if(!cmd.create_pin_object(reply)){ + return -1; + } + break; + case -2: + // delete + itor = cmd.pinObjects.find(cmd.get_pin_name()); + if(itor == cmd.pinObjects.end()){ + printf("The pin is not created.\r\n"); + return HTTP_404_NOTFOUND; + } + delete itor->second; + cmd.pinObjects.erase(cmd.pinObjects.find(cmd.get_pin_name())); + break; + default: + return -1; + } + + return HTTP_200_OK; +} + + +int DeleteRequestHandler::handle(RPCObject& cmd, char* reply) +{ + std::map<PinName, RPCClass*>::iterator itor; + + printf("handling DELETE request.\r\n"); + itor = cmd.pinObjects.find(cmd.get_pin_name()); + if(itor == cmd.pinObjects.end()){ + printf("The pin is not created.\r\n"); + return HTTP_404_NOTFOUND; + } + delete itor->second; + cmd.pinObjects.erase(cmd.pinObjects.find(cmd.get_pin_name())); + + return HTTP_200_OK; +} + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RequestHandler.h Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,45 @@ +#ifndef REQUEST_HANDLER +#define REQUEST_HANDLER + +#include "RPCObject.h" + + + +class RequestHandler +{ + public : + + virtual int handle(RPCObject& cmd, char* reply) = 0; + + protected : +}; + +class GetRequestHandler : public RequestHandler +{ + public : + + virtual int handle(RPCObject& cmd, char* reply); + +}; + +class PostRequestHandler : public RequestHandler +{ + public : + + virtual int handle(RPCObject& cmd, char* reply); + +}; + + +class DeleteRequestHandler : public RequestHandler +{ + public : + + virtual int handle(RPCObject& cmd, char* reply); + +}; + + + +#endif +
--- a/SNICInterface_mod.lib Sat Jan 31 13:49:47 2015 +0000 +++ b/SNICInterface_mod.lib Thu Mar 12 12:27:31 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/MACRUM/code/SNICInterface_mod/#5a5cae02bdf0 +http://developer.mbed.org/teams/KDDI-Fx0-hackathon/code/SNICInterface_mod2/#7729db2580c4
--- a/main.cpp Sat Jan 31 13:49:47 2015 +0000 +++ b/main.cpp Thu Mar 12 12:27:31 2015 +0000 @@ -1,7 +1,11 @@ #include "mbed.h" #include "SNIC_WifiInterface.h" -#include "HTTPClient.h" +// KTEC MOD START +//#include "HTTPClient.h" +#include "HTTPServer.h" +#include "RPC_Function.h" +// KTEC MOD END #if defined(TARGET_LPC1768) #include "PowerControl/EthernetPowerControl.h" #endif @@ -9,6 +13,9 @@ #define DEMO_AP_SSID "SSID" #define DEMO_AP_SECURITY_TYPE e_SEC_WPA2_AES #define DEMO_AP_SECUTIRY_KEY "PASSWORD" +// KTEC ADD START +#define PORT_NUMBER 80 +// KTEC ADD END C_SNIC_WifiInterface wifi( p9, p10, NC, NC, p30 ); @@ -16,8 +23,12 @@ Serial pc(USBTX, USBRX); #endif +// KTEC DEL START +/* HTTPClient http; char str[512]; +*/ +// KTEC DEL END int main() { @@ -30,21 +41,43 @@ wait(0.5); int s = wifi.disconnect(); if( s != 0 ) { +// KTEC ADD START + printf("wifi.disconnect error.\r\n"); +// KTEC ADD END return -1; } wait(0.3); // Connect AP - wifi.connect( DEMO_AP_SSID +// KTEC MOD START + s = wifi.connect( DEMO_AP_SSID , strlen(DEMO_AP_SSID) , DEMO_AP_SECURITY_TYPE , DEMO_AP_SECUTIRY_KEY , strlen(DEMO_AP_SECUTIRY_KEY) ); + if( s != 0 ) { + printf("wifi.connect error.\r\n"); + return -1; + } +// KTEC MOD END wait(0.5); wifi.setIPConfig( true ); wait(0.5); printf("IP Address is %s\n", wifi.getIPAddress()); + +// KTEC ADD START + HTTPServer srv; + printf("server init.\r\n"); + srv.init(PORT_NUMBER); + + wait(1); + printf("server running.\r\n"); + srv.run(); +// KTEC ADD END + +// KTEC DEL START +/* //GET data printf("\nTrying to fetch page...\n"); int ret = http.get("http://developer.mbed.org/media/uploads/donatien/hello.txt", str, 128); @@ -109,4 +142,6 @@ while(1) { } +*/ +// KTEC DEL END }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/parse_pins.cpp Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,80 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "port_api.h" + +namespace mbed { + +PinName parse_pins(const char *str) { +#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) + static const PinName pin_names[] = {p5, p6, p7, p8, p9, p10, p11, p12, p13, p14 + , p15, p16, p17, p18, p19, p20, p21, p22, p23 + , p24, p25, p26, p27, p28, p29, p30}; +#endif + +#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368) || defined(TARGET_LPC812) || defined(TARGET_LPC4088) + if (str[0] == 'P') { // Pn_n + uint32_t port = str[1] - '0'; + uint32_t pin = str[3] - '0'; // Pn_n + uint32_t pin2 = str[4] - '0'; // Pn_nn + if (pin2 <= 9) { + pin = pin * 10 + pin2; + } + return port_pin((PortName)port, pin); + +#elif defined(TARGET_KL25Z) + if (str[0] == 'P' && str[1] == 'T') { // PTx_n + uint32_t port = str[2] - 'A'; + uint32_t pin = str[3] - '0'; // PTxn + uint32_t pin2 = str[4] - '0'; // PTxnn + + if (pin2 <= 9) { + pin = pin * 10 + pin2; + } + return port_pin((PortName)port, pin); +#endif + +#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) + } else if (str[0] == 'p') { // pn + uint32_t pin = str[1] - '0'; // pn + uint32_t pin2 = str[2] - '0'; // pnn + if (pin2 <= 9) { + pin = pin * 10 + pin2; + } + if (pin < 5 || pin > 30) { + return NC; + } + return pin_names[pin - 5]; +#endif + + } else if (str[0] == 'L') { // LEDn + switch (str[3]) { + case '1' : return LED1; + case '2' : return LED2; + case '3' : return LED3; + case '4' : return LED4; + } + + } else if (str[0] == 'U') { // USB?X + switch (str[3]) { + case 'T' : return USBTX; + case 'R' : return USBRX; + } + } + + return NC; +} + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/parse_pins.h Thu Mar 12 12:27:31 2015 +0000 @@ -0,0 +1,27 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef MBED_PINMAP_H +#define MBED_PINMAP_H + +#include "PinNames.h" + +namespace mbed { + +PinName parse_pins(const char *str); + +} + +#endif