Article updated
at 28 Oct 2017
Attention: this is a legacy library and thus not supported by Toradex anymore. We recommend that you use the new libraries for all Toradex modules. Please see the Toradex CE Libraries and Code Samples for up-to-date information.
Contains function declarations to be used to access AWS Cloud Sns Services Colibri Modules [PXAxxx, Tegra T20], WinCE 6.0 / 7.0 Number of Topics are restricted to 100, number of subscriptions per Topic are limited to 100. More...
|
BOOL |
SnsOpenTopic (char *accessID, char *secretKey, char *ownerId, char *path, char *topicName, char *displayName, HSNS *snsTopicHandle) |
|
BOOL |
SnsCloseTopic (HSNS *snsTopicHandle) |
|
BOOL |
SnsCreateTopic (HSNS snsTopicHandle) |
|
BOOL |
SnsPublish (HSNS snsTopicHandle, const char *subject, const char *message) |
|
BOOL |
SnsDeleteTopic (HSNS snsTopicHandle) |
|
BOOL |
SnsSubscribe (HSNS snsTopicHandle, char *endPoint, BYTE protocolType) |
|
BOOL |
SnsListTopics (HSNS snsTopicHandle, char *filePath) |
|
BOOL |
SnsUnsubscribe (HSNS snsTopicHandle, char *subArn) |
|
BOOL |
SnsListSubscriptions (HSNS snsTopicHandle, char *filePath) |
|
BOOL |
SnsFindTopic (const char *filePath, char *dataOut, DWORD dataOutSize, DWORD *pointerToNextTopic, DWORD fileSize) |
|
BOOL |
SnsFindSubscriptions (const char *filePath, char *dataOut, DWORD dataOutSize, DWORD *pointerToNextSubscriptionByTopic, DWORD fileSize) |
|
BOOL |
SnsGetSubscriptionAttribtues (HSNS snsTopicHandle, char *subArn, char *dataOut, DWORD dataOutSize) |
|
BOOL |
SnsGetTopicAttributes (HSNS snsTopicHandle, char *dataOut, DWORD dataOutSize) |
|
BOOL |
SnsSetTopicAttributes (HSNS snsTopicHandle, BYTE attributeType, char *attributeValue) |
|
Contains function declarations to be used to access AWS Cloud Sns Services Colibri Modules [PXAxxx, Tegra T20], WinCE 6.0 / 7.0 Number of Topics are restricted to 100, number of subscriptions per Topic are limited to 100.
- Copyright
- Copyright (c) 2012 Toradex AG [Software License Agreement]
- Author
- Author:
- agp
- Version
- Rev:
- 1154
- Date
- Date:
- 2012-11-08 19:56:19 +0530 (Thu, 08 Nov 2012)
BOOL SnsCloseTopic |
( |
HSNS * |
snsTopicHandle |
) |
|
Deletes already created Sns Topic Handle
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsCreateTopic |
( |
HSNS |
snsTopicHandle |
) |
|
Creates new Sns Topic
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsDeleteTopic |
( |
HSNS |
snsTopicHandle |
) |
|
Deletes already existing Sns Topic
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsFindSubscriptions |
( |
const char * |
filePath, |
|
|
char * |
dataOut, |
|
|
DWORD |
dataOutSize, |
|
|
DWORD * |
pointerToNextSubscriptionByTopic, |
|
|
DWORD |
fileSize |
|
) |
|
|
Finds Subscription details by Topic from list of subscriptionsByTopic stored in a local file
The file must be initialized by calling SnsListSubscriptionsByTopic()
- Parameters
-
[in] |
filePath |
File path in which list of subscription exists |
[out] |
dataOut |
Pointer to the output string containing subscription details, user need to allocate memory |
[in] |
dataOutSize |
Number of bytes allocated for dataOut |
[in,out] |
pointerToNextSubscriptionByTopic |
Pointer to next Subscription details from list data, to find 1st Subscription by topic Detail, put NULL |
[in] |
fileSize |
Size of the file in bytes |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsFindTopic |
( |
const char * |
filePath, |
|
|
char * |
dataOut, |
|
|
DWORD |
dataOutSize, |
|
|
DWORD * |
pointerToNextTopic, |
|
|
DWORD |
fileSize |
|
) |
|
|
Finds Topic Details from list of Topics stored in a local file
The file must be initialized by calling SnsListTopics()
- Parameters
-
[in] |
filePath |
File path in which list of subscription exists |
[out] |
dataOut |
Pointer to the output string containing Topic details, user need to allocate memory |
[in] |
dataOutSize |
Number of bytes allocated for dataOut |
[in,out] |
pointerToNextTopic |
Pointer to next Topic details from list data, to find 1st topic details, put NULL. |
[in] |
fileSize |
Size of the file in bytes |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsGetSubscriptionAttribtues |
( |
HSNS |
snsTopicHandle, |
|
|
char * |
subArn, |
|
|
char * |
dataOut, |
|
|
DWORD |
dataOutSize |
|
) |
|
|
Gets Subscription Attributes
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
[in] |
subArn |
Subscription Arn String |
[out] |
dataOut |
Pointer to the output string containing subscription attributes details, user need to allocate memory |
[in] |
dataOutSize |
Number of bytes allocated for dataOut |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsGetTopicAttributes |
( |
HSNS |
snsTopicHandle, |
|
|
char * |
dataOut, |
|
|
DWORD |
dataOutSize |
|
) |
|
|
Gets Topic Attributes of Sns Topic
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
[out] |
dataOut |
Pointer to the output string containing TopicAttribute details, user need to allocate memory |
[in] |
dataOutSize |
Number of bytes allocated for dataOut |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsListSubscriptions |
( |
HSNS |
snsTopicHandle, |
|
|
char * |
filePath |
|
) |
|
|
Lists Subscriptions by topic in an Sns Account, for a particular region (max 100)
Subscriptions by Topic are stored into a local file
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
[in] |
filePath |
File in which list of Subscriptions by topics will be saved, user need to delete already existing file, else list data will be appended in the same file |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() Number of Topics are restricted to 100, number of subscriptions per Topic are limited to 100 |
BOOL SnsListTopics |
( |
HSNS |
snsTopicHandle, |
|
|
char * |
filePath |
|
) |
|
|
Lists topics in an Sns Account, for a particular region (max 100)
Topics are stored into a local file
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
[in] |
filePath |
File in which list of topics will be saved, user need to delete already existing file, else list data will be appended in the same file |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() Number of Topics are restricted to 100, number of subscriptions per Topic are limited to 100 |
BOOL SnsOpenTopic |
( |
char * |
accessID, |
|
|
char * |
secretKey, |
|
|
char * |
ownerId, |
|
|
char * |
path, |
|
|
char * |
topicName, |
|
|
char * |
displayName, |
|
|
HSNS * |
snsTopicHandle |
|
) |
|
|
Opens handle for Sns topic, the returned snsTopicHandle is required as an input parameter to every Sns function call
- Parameters
-
[in] |
accessID |
AWS Access ID [20 Characters] |
[in] |
secretKey |
AWS Secret Key [40 Characters] |
[in] |
ownerId |
AWS Owner ID [12 Characters] |
[in] |
path |
AWS Sns path |
[in] |
topicName |
Topic names must be constructed using only uppercase and lowercase ASCII letters, numbers, underscore, hyphens and must be between 1 and 256 characters long |
[in] |
displayName |
[OPTIONAL] if not NULL, Display names must be constructed using only uppercase/lowercase ASCII letters, numbers, underscore, hyphens and must be between 1 and 100 characters long |
[out] |
snsTopicHandle |
Structure to hold various sns related parameters. |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsPublish |
( |
HSNS |
snsTopicHandle, |
|
|
const char * |
subject, |
|
|
const char * |
message |
|
) |
|
|
Publishes/Sends a message to all the subscribed endpoints of a topic. When a messageId is returned,
the message has been saved and Amazon Sns will attempt to deliver it to the topic subscribers shortly
The format of the outgoing message to each subscribed endpoint depends on the notification protocol selected
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
[in] |
subject |
Optional parameter to be used as the "Subject" line, when the message is delivered to e-mail endpoints, max 100 ASCII characters |
[in] |
message |
The message you want to send to the topic. Maximum length is 32 x 1024 characters |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsSetTopicAttributes |
( |
HSNS |
snsTopicHandle, |
|
|
BYTE |
attributeType, |
|
|
char * |
attributeValue |
|
) |
|
|
Sets Topic Attributes
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
[in] |
attributeType |
[1] - Policy, [2] - DisplayName, [3] - DeliveryPolicy |
[in] |
attributeValue |
String containing respective attribute value |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() only attributes = 2 (DisplayName) is working |
BOOL SnsSubscribe |
( |
HSNS |
snsTopicHandle, |
|
|
char * |
endPoint, |
|
|
BYTE |
protocolType |
|
) |
|
|
Subscribes an endpoint to a topic
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
[in] |
endPoint |
URL "http://", URL "https://" , Email ID, Phone number for SMS, SQS: ARN of an Amazon SQS queue, etc |
[in] |
protocolType |
Valid Values can be from 1 to 6, [1] - "http", [2] - "https", [3] - "email", [4] - "email-json", [5] - "sms", [6] - "sqs" |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |
BOOL SnsUnsubscribe |
( |
HSNS |
snsTopicHandle, |
|
|
char * |
subArn |
|
) |
|
|
Unsubscribes an endpoint from its subscription
- Parameters
-
[in] |
snsTopicHandle |
Handle returned by call to SnsTopicOpen() |
[in] |
subArn |
Subscription Arn String |
- Return values
-
TRUE |
Success |
FALSE |
See GetLastError() |