-
Notifications
You must be signed in to change notification settings - Fork 24
/
FacebookShield.cpp
46 lines (35 loc) · 1.13 KB
/
FacebookShield.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Project: 1Sheeld Library
File: FacebookShield.cpp
Version: 1.0
Compiler: Arduino avr-gcc 4.3.2
Author: Integreight
Date: 2014.5
*/
#define FROM_ONESHEELD_LIBRARY
#include "OneSheeld.h"
#include "FacebookShield.h"
//Post Sender
void FacebookShieldClass::post(const char* status)
{
//Check length of string
int statusLength = strlen(status);
if(!statusLength) return;
OneSheeld.sendShieldFrame(FACEBOOK_ID,0,FACEBOOK_UPDATE_STATUS,1,new FunctionArg(statusLength,(byte*)status));
}
void FacebookShieldClass::post(String status)
{
post(&status[0]);
}
void FacebookShieldClass::postLastPicture(const char * pictureText, byte imageSource)
{
//Check length of string
int pictureTextLength = strlen(pictureText);
if(!pictureTextLength) return;
OneSheeld.sendShieldFrame(FACEBOOK_ID,0,FACEBOOK_POST_LAST_PIC,2,new FunctionArg(pictureTextLength,(byte*)pictureText),
new FunctionArg(1,(byte *)&imageSource));
}
void FacebookShieldClass::postLastPicture(String pictureText , byte imageSource)
{
postLastPicture(&pictureText[0],imageSource);
}