To call Azure Marketplace Translation (and Speech) service

Dependencies:   EthernetInterface-FRDM HTTPClient-SSL R_BSP SDFileSystem TLV320_RBSP USBHost mbed-rtos mbed-src

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AdmAuthentication.h Source File

AdmAuthentication.h

00001 ////////////////////////////////////////////////////////////////////////////
00002 //  Licensed under the Apache License, Version 2.0 (the "License");
00003 //  you may not use this file except in compliance with the License.
00004 //  You may obtain a copy of the License at
00005 //
00006 //    http://www.apache.org/licenses/LICENSE-2.0
00007 //
00008 //  Unless required by applicable law or agreed to in writing, software
00009 //  distributed under the License is distributed on an "AS IS" BASIS,
00010 //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00011 //  See the License for the specific language governing permissions and
00012 //  limitations under the License.
00013 //
00014 //  Copyright (c) Microsoft Corporation.  All rights reserved.
00015 //  Portions Copyright (c) Kentaro Sekimoto All rights reserved.
00016 //
00017 //  Based on Text-To-Speech for .NET Micro Framework with Microsoft 
00018 //  Translator Service
00019 //  https://code.msdn.microsoft.com/Text-To-Speech-for-NET-9cea4462
00020 //
00021 ////////////////////////////////////////////////////////////////////////////
00022 
00023 #include "mbed.h"
00024 
00025 class AdmAuthentication
00026 {
00027 public:
00028     AdmAuthentication(char *clientID, char *clientSecret);
00029     ~AdmAuthentication();
00030     char *GetAccessToken();
00031     char *HttpPost(char *DatamarketAccessUri, char *requestDetails);
00032     
00033 private:
00034     char *id;
00035     char *secret;
00036     char encoded_id[64];
00037     char encoded_secret[64];
00038     char request[256];
00039     char token[1024];
00040     char url[128];
00041 };