To call Azure Marketplace Translation (and Speech) service

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

The program calls Azure Marketplace Translation (and Speech) service.

How to use - Create an account for Microsoft Azure Marketplace - Get client ID and client secret. - Change client ID and client secret in main.cpp

The program was created based on the following libraries.

CodePlex Text-To-Speech with Microsoft Translator Service http://translatorservice.codeplex.com/

MBED HTTPClient-SSL Library https://developer.mbed.org/teams/MultiTech/code/HTTPClient-SSL/

/media/uploads/ksekimoto/gr-peach_cloud_speech_01.jpg

Committer:
ksekimoto
Date:
Sat Nov 07 12:29:06 2015 +0000
Revision:
1:a2bd45c3b373
Parent:
0:40a09c55e5be
To call Azure Marketplace Translation (and Speech) service.; The first version.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ksekimoto 0:40a09c55e5be 1 ////////////////////////////////////////////////////////////////////////////
ksekimoto 0:40a09c55e5be 2 // Licensed under the Apache License, Version 2.0 (the "License");
ksekimoto 0:40a09c55e5be 3 // you may not use this file except in compliance with the License.
ksekimoto 0:40a09c55e5be 4 // You may obtain a copy of the License at
ksekimoto 0:40a09c55e5be 5 //
ksekimoto 0:40a09c55e5be 6 // http://www.apache.org/licenses/LICENSE-2.0
ksekimoto 0:40a09c55e5be 7 //
ksekimoto 0:40a09c55e5be 8 // Unless required by applicable law or agreed to in writing, software
ksekimoto 0:40a09c55e5be 9 // distributed under the License is distributed on an "AS IS" BASIS,
ksekimoto 0:40a09c55e5be 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ksekimoto 0:40a09c55e5be 11 // See the License for the specific language governing permissions and
ksekimoto 0:40a09c55e5be 12 // limitations under the License.
ksekimoto 0:40a09c55e5be 13 //
ksekimoto 0:40a09c55e5be 14 // Copyright (c) Microsoft Corporation. All rights reserved.
ksekimoto 0:40a09c55e5be 15 // Portions Copyright (c) Kentaro Sekimoto All rights reserved.
ksekimoto 0:40a09c55e5be 16 //
ksekimoto 0:40a09c55e5be 17 // Based on Text-To-Speech for .NET Micro Framework with Microsoft
ksekimoto 0:40a09c55e5be 18 // Translator Service
ksekimoto 0:40a09c55e5be 19 // https://code.msdn.microsoft.com/Text-To-Speech-for-NET-9cea4462
ksekimoto 0:40a09c55e5be 20 //
ksekimoto 0:40a09c55e5be 21 ////////////////////////////////////////////////////////////////////////////
ksekimoto 0:40a09c55e5be 22
ksekimoto 0:40a09c55e5be 23 #include "mbed.h"
ksekimoto 0:40a09c55e5be 24
ksekimoto 0:40a09c55e5be 25 class AdmAuthentication
ksekimoto 0:40a09c55e5be 26 {
ksekimoto 0:40a09c55e5be 27 public:
ksekimoto 0:40a09c55e5be 28 AdmAuthentication(char *clientID, char *clientSecret);
ksekimoto 0:40a09c55e5be 29 ~AdmAuthentication();
ksekimoto 0:40a09c55e5be 30 char *GetAccessToken();
ksekimoto 0:40a09c55e5be 31 char *HttpPost(char *DatamarketAccessUri, char *requestDetails);
ksekimoto 0:40a09c55e5be 32
ksekimoto 0:40a09c55e5be 33 private:
ksekimoto 0:40a09c55e5be 34 char *id;
ksekimoto 0:40a09c55e5be 35 char *secret;
ksekimoto 0:40a09c55e5be 36 char encoded_id[64];
ksekimoto 0:40a09c55e5be 37 char encoded_secret[64];
ksekimoto 0:40a09c55e5be 38 char request[256];
ksekimoto 0:40a09c55e5be 39 char token[1024];
ksekimoto 0:40a09c55e5be 40 char url[128];
ksekimoto 0:40a09c55e5be 41 };