Update GSM SMS.

This commit is contained in:
bossiel 2010-04-12 17:08:48 +00:00
parent 125bde5959
commit 5743765ea1
108 changed files with 1580 additions and 111 deletions

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -3,7 +3,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -184,8 +184,7 @@ tsk_object_t* tsk_object_ref(tsk_object_t *self)
*/
tsk_object_t* tsk_object_unref(tsk_object_t *self)
{
if(self)
{
if(self){
tsk_object_header_t* objhdr = TSK_OBJECT_HEADER(self);
if(objhdr->refCount && !--objhdr->refCount){ // If refCount is == 0 then, nothing should happen.
tsk_object_delete(self);

View File

@ -213,6 +213,25 @@ void tsk_strcat(char** destination, const char* source)
tsk_strncat(destination, source, strlen(source));
}
/**@ingroup tsk_string_group
*/
void tsk_strcat_2(char** destination, const char* format, ...)
{
char* temp = tsk_null;
int len;
va_list ap;
/* initialize variable arguments */
va_start(ap, format);
/* compute */
if((len = tsk_sprintf_2(&temp, format, &ap))){
tsk_strncat(destination, temp, len);
}
/* reset variable arguments */
va_end(ap);
TSK_FREE(temp);
}
/**@ingroup tsk_string_group
*/
void tsk_strncat(char** destination, const char* source, size_t n)
@ -247,11 +266,24 @@ void tsk_strncat(char** destination, const char* source, size_t n)
*/
int tsk_sprintf(char** str, const char* format, ...)
{
int len = 0;
va_list list;
int len;
va_list ap;
/* initialize variable arguments */
va_start(list, format);
va_start(ap, format);
/* compute */
len = tsk_sprintf_2(str, format, &ap);
/* reset variable arguments */
va_end(ap);
return len;
}
/**@ingroup tsk_string_group
*/
int tsk_sprintf_2(char** str, const char* format, va_list* ap)
{
int len = 0;
/* free previous value */
if(*str){
@ -265,16 +297,13 @@ int tsk_sprintf(char** str, const char* format, ...)
int n;
len = (strlen(format)*2);
*str = (char*)tsk_calloc(1, len+1);
for(;;)
{
if( (n = vsnprintf(*str, len, format, list)) >= 0 && (n<len) )
{
for(;;){
if( (n = vsnprintf(*str, len, format, *ap)) >= 0 && (n<len) ){
len = n;
goto done;
}
else
{
len += 5;
else{
len += 10;
*str = tsk_realloc(*str, len+1);
}
}
@ -282,18 +311,15 @@ done:
(*str)[len] = '\0';
}
#else
len = vsnprintf(0, 0, format, list);
len = vsnprintf(0, 0, format, *ap);
*str = (char*)tsk_calloc(1, len+1);
vsnprintf(*str, len
#if !defined(_MSC_VER) || defined(__GNUC__)
+1
#endif
, format, list);
, format, *ap);
#endif
/* reset variable arguments */
va_end( list );
return len;
}

View File

@ -62,8 +62,10 @@ TINYSAK_API char* tsk_strndup(const char *s1, size_t n);
TINYSAK_API tsk_bool_t tsk_strcontains(const char * str, size_t size, const char * substring);
TINYSAK_API int tsk_strindexOf(const char * str, size_t size, const char * substring);
TINYSAK_API void tsk_strcat(char** destination, const char* source);
TINYSAK_API void tsk_strcat_2(char** destination, const char* format, ...);
TINYSAK_API void tsk_strncat(char** destination, const char* source, size_t n);
TINYSAK_API int tsk_sprintf(char** str, const char* format, ...);
TINYSAK_API int tsk_sprintf_2(char** str, const char* format, va_list* ap);
TINYSAK_API void tsk_strupdate(char** str, const char* newval);
TINYSAK_API void tsk_strtrim_left(char **str);
TINYSAK_API void tsk_strtrim_right(char **str);

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,3 +1,25 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
#ifndef TSDP_TEST_TARGETVER_H
#define TSDP_TEST_TARGETVER_H
// The following macros define the minimum required platform. The minimum required platform

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
///*
//* Copyright (C) 2009 Mamadou Diop.
//*
//* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
//* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
//*
//* This file is part of Open Source Doubango Framework.
//*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*

View File

@ -0,0 +1,25 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
#include "tinySMS/tsms_packing.h"
#include "tinySMS/rpdu/tsms_rpdu.h"
#include "tinySMS/tpdu/tsms_tpdu.h"

View File

@ -32,18 +32,33 @@
#include "tinysms_config.h"
#include "tsk_object.h"
#include "tinySMS/tsms_common.h"
#include "tsk_buffer.h"
TSMS_BEGIN_DECLS
typedef struct tsms_tpdu_s
typedef struct tsms_tpdu_ctx_s
{
TSK_DECLARE_OBJECT;
uint8_t mr;
char* smsc; /**< SMSC*/
char* phone; /**< Remote Phone number. */
tsms_alphabet_t alphabet; /**< User data. */
tsk_buffer_t* usrdata; /**< User data. */
}
tsms_tpdu_t;
tsms_tpdu_ctx_t;
typedef void tsms_tpdu_ctx_handle_t;
TINYSMS_API tsms_tpdu_ctx_handle_t* tsms_pdu_ctx_create(uint8_t mr, tsms_address_t smsc, tsms_address_t phone);
TINYSMS_API int tsms_pdu_ctx_set_alphabet(tsms_tpdu_ctx_handle_t* handle, tsms_alphabet_t alphabet);
TINYSMS_API int tsms_pdu_ctx_set_usrdata(tsms_tpdu_ctx_handle_t* handle, const void* data, size_t size);
TINYSMS_API tsk_buffer_t* tsms_pdu_ctx_getSUBMIT(tsms_tpdu_ctx_handle_t* handle);
TINYSMS_GEXTERN const tsk_object_def_t *tsms_tpdu_ctx_def_t;
TSMS_END_DECLS

View File

@ -20,7 +20,7 @@
*
*/
/**@file tsms_tpdu.h
/**@file tsms_tpdu_command.h
* @brief SMS TPDU SMS-COMMAND message as per 3GPP TS 23.040 section 9.2.2.4.
*
* @author Mamadou Diop <diopmamadou(at)doubango.org>
@ -37,6 +37,8 @@
TSMS_BEGIN_DECLS
#define TSMS_TPDU_COMMAND_CREATE() tsk_object_new(tsms_tpdu_command_def_t)
/** SMS TPDU SMS-COMMAND message as per 3GPP TS 23.040 section 9.2.2.4.
*/
typedef struct tsms_tpdu_command_s
@ -63,7 +65,7 @@ typedef struct tsms_tpdu_command_s
uint8_t mn;
/** TP Destination Address (M - 2-12o)
* Parameter indicating the Destination Address to which the TP Command refers. */
uint8_t da[12];
tsms_address_t da;
/** TP Command Data Length (M - o)
* Parameter indicating the length of the TP-CD field in octets. */
uint8_t cdl;
@ -73,4 +75,6 @@ typedef struct tsms_tpdu_command_s
}
tsms_tpdu_command_t;
TINYSMS_GEXTERN const tsk_object_def_t *tsms_tpdu_command_def_t;
#endif /* TINYSMS_TSMS_TPDU_COMMAND_H */

View File

@ -60,7 +60,7 @@ typedef struct tsms_tpdu_deliver_s
unsigned sri:1;
/** TP Originating Address (M - 2-12o)
* Address of the originating SME. */
uint8_t oa[12];
tsms_address_t oa;
/** TP Protocol Identifier (M - o)
* Parameter identifying the above layer protocol, if any. */
uint8_t pid;

View File

@ -60,7 +60,7 @@ typedef struct tsms_tpdu_status_report_s
unsigned mr;
/** TP Recipient Address (M - 2-12o)
* Address of the recipient of the previously submitted mobile originated short message. */
uint8_t ra[12];
tsms_address_t ra;
/** TP Service Centre Time Stamp (M - 7o)
* Parameter identifying time when the SC received the previously sent SMS SUBMIT. */
uint8_t scts[7];

View File

@ -37,6 +37,9 @@
TSMS_BEGIN_DECLS
#define TSMS_TPDU_SUBMIT_CREATE() tsk_object_new(tsms_tpdu_submit_def_t)
/** SMS TPDU SMS-SUBMIT message as per 3GPP TS 23.040 section 9.2.2.2
*/
typedef struct tsms_tpdu_submit_s
@ -65,7 +68,10 @@ typedef struct tsms_tpdu_submit_s
unsigned mr;
/** TP Destination Address (M - 2-12o)
* Address of the destination SME. */
uint8_t da[12];
tsms_address_t da;
/** TP Protocol Identifier (M - o)
* Parameter identifying the above layer protocol, if any. */
uint8_t pid;
/** TP Data Coding Scheme (M - o)
* Parameter identifying the coding scheme within the TP User Data. */
uint8_t dcs;
@ -81,6 +87,9 @@ typedef struct tsms_tpdu_submit_s
}
tsms_tpdu_submit_t;
TINYSMS_GEXTERN const tsk_object_def_t *tsms_tpdu_submit_def_t;
TSMS_END_DECLS
#endif /* TINYSMS_TSMS_TPDU_SUBMIT_H */

View File

@ -32,16 +32,22 @@
#include "tinysms_config.h"
#include "tsk_object.h"
#include "tsk_buffer.h"
TSMS_BEGIN_DECLS
typedef uint8_t tsms_address_t[12];
typedef int (*tsms_tpdu_message_serialize_f)(const struct tsms_tpdu_message_s* self, const tsk_buffer_t* output);
/** SMS alphabet values as per 3GPP TS 23.038 v911 section 4.
* Part of TP-DCS (SMS Data Coding Scheme).
*/
typedef enum tsms_alphabet_e
{
/*11*/ tsms_alpha_reserved = 0x03,
/*00*/ tsms_alpha_7bit = 0x00,
/*01*/ tsms_alpha_8bit = 0x01,
/*10*/ tsms_alpha_ucs2 = 0x02
}
tsms_alphabet_t;
@ -65,10 +71,15 @@ typedef struct tsms_tpdu_message_s
{
TSK_DECLARE_OBJECT;
tsms_tpdu_mti_t mti; /**< TP Message Type Indicator (TP MTI) as per TS 23.040 section 9.2.3.1. 2-bit field. */
tsms_tpdu_message_serialize_f serialize;
}
tsms_tpdu_message_t;
#define TSMS_DECLARE_TPDU_MESSAGE tsms_tpdu_message_t tpdu
#define TSMS_TPDU_MESSAGE(self) ((tsms_tpdu_message_t*)(self))
#define TSMS_TPDU_MESSAGE_SERIALIZE_F(self) ((tsms_tpdu_message_serialize_f)(self))
#define TSMS_TPDU_APPEND_SMSC 1
TSMS_END_DECLS

View File

@ -35,7 +35,7 @@
TSMS_BEGIN_DECLS
#define TSMS_ETSI_GSM_03_38_COUNT 123
static const uint16_t TSMS_ETSI_GSM_03_38[TSMS_ETSI_GSM_03_38_COUNT][2] =
static uint16_t TSMS_ETSI_GSM_03_38[TSMS_ETSI_GSM_03_38_COUNT][2] =
{
0x00, 0x0040 ,//# COMMERCIAL AT
0x01, 0x00A3 ,//# POUND SIGN

View File

@ -0,0 +1,49 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsms_packing.h
* @brief SMS Packing (3GPP TS 23.038 subclause 6.1.2).
*
* @author Mamadou Diop <diopmamadou(at)doubango.org>
*
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/
#ifndef TINYSMS_TSMS_PACKING_H
#define TINYSMS_TSMS_PACKING_H
#include "tinysms_config.h"
#include "tsk_buffer.h"
TSMS_BEGIN_DECLS
TINYSMS_API tsk_buffer_t* tsms_pack_to_7bit(const char* ascii);
TINYSMS_API tsk_buffer_t* tsms_pack_to_ucs2(const char* ascii);
TINYSMS_API tsk_buffer_t* tsms_pack_to_8bit(const char* ascii);
TINYSMS_API char* tsms_pack_from_7bit(const void* gsm7bit, size_t size);
TINYSMS_API char* tsms_pack_from_ucs2(const void* ucs2, size_t size);
TINYSMS_API char* tsms_pack_from_8bit(const void* gsm8bit, size_t size);
TSMS_END_DECLS
#endif /* TINYSMS_TSMS_PACKING_H */

View File

@ -20,7 +20,7 @@
*
*/
/**@file tsms_tpdu.c
/**@file tsms_tpdu_ctx.c
* @brief SMS TPDU encoder/decoder as per 3GPP TS 23.040.
*
* @author Mamadou Diop <diopmamadou(at)doubango.org>
@ -28,3 +28,127 @@
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/
#include "tinySMS/tpdu/tsms_tpdu.h"
#include "tinySMS/tpdu/tsms_tpdu_submit.h"
#include "tsk_string.h"
#include "tsk_memory.h"
#include "tsk_debug.h"
/**@defgroup tsms_pdu_group SMS TPDU encoder/decoder
*/
/**@ingroup tsms_pdu_group
*/
tsms_tpdu_ctx_handle_t* tsms_pdu_ctx_create(uint8_t mr, tsms_address_t smsc, tsms_address_t phone)
{
tsms_tpdu_ctx_t* ret = tsk_null;
if(!smsc){
TSK_DEBUG_ERROR("SMSC is Null.");
goto bail;
}
if(!(ret = tsk_object_new(tsms_tpdu_ctx_def_t, mr, smsc, phone))){
goto bail;
}
bail:
return ret;
}
/**@ingroup tsms_pdu_group
*/
int tsms_pdu_ctx_set_alphabet(tsms_tpdu_ctx_handle_t* handle, tsms_alphabet_t alphabet)
{
tsms_tpdu_ctx_t* ctx = handle;
if(ctx){
ctx->alphabet = alphabet;
return 0;
}
return -1;
}
/**@ingroup tsms_pdu_group
*/
int tsms_pdu_ctx_set_usrdata(tsms_tpdu_ctx_handle_t* handle, const void* data, size_t size)
{
tsms_tpdu_ctx_t* ctx = handle;
if(ctx && data && size){
TSK_OBJECT_SAFE_FREE(ctx->usrdata);
ctx->usrdata = TSK_BUFFER_CREATE(data, size);
return 0;
}
return -1;
}
/**@ingroup tsms_pdu_group
*/
tsk_buffer_t* tsms_pdu_ctx_getSUBMIT(tsms_tpdu_ctx_handle_t* handle)
{
tsk_buffer_t* output = tsk_null;
tsms_tpdu_submit_t* submit = tsk_null;
tsms_tpdu_ctx_t* ctx = handle;
if(!ctx){
TSK_DEBUG_ERROR("TPDU handle is Null.");
goto bail;
}
if((submit = TSMS_TPDU_SUBMIT_CREATE())){
output = TSK_BUFFER_CREATE_NULL();
TSMS_TPDU_MESSAGE(submit)->serialize(TSMS_TPDU_MESSAGE(submit), output);
}
else{
goto bail;
}
bail:
TSK_OBJECT_SAFE_FREE(submit);
return output;
}
//=================================================================================================
// SMS TPDU object definition
//
static tsk_object_t* _tsms_tpdu_ctx_create(tsk_object_t * self, va_list * app)
{
tsms_tpdu_ctx_t *ctx = self;
if(ctx){
#if defined(__GNUC__)
ctx->mr = va_arg(*app, unsigned);
#else
ctx->mr = va_arg(*app, uint8_t);
#endif
ctx->smsc = tsk_strdup( va_arg(*app, const char*) );
ctx->phone = tsk_strdup( va_arg(*app, const char*) );
ctx->alphabet = tsms_alpha_7bit;
}
return self;
}
static tsk_object_t* tsms_tpdu_ctx_destroy(tsk_object_t * self)
{
tsms_tpdu_ctx_t *ctx = self;
if(ctx){
TSK_FREE(ctx->smsc);
TSK_FREE(ctx->phone);
TSK_OBJECT_SAFE_FREE(ctx->usrdata);
}
return self;
}
static const tsk_object_def_t tsms_tpdu_ctx_def_s =
{
sizeof(tsms_tpdu_ctx_t),
_tsms_tpdu_ctx_create,
tsms_tpdu_ctx_destroy,
tsk_null,
};
const tsk_object_def_t *tsms_tpdu_ctx_def_t = &tsms_tpdu_ctx_def_s;

View File

@ -0,0 +1,69 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsms_tpdu_command.c
* @brief SMS TPDU SMS-COMMAND message as per 3GPP TS 23.040 section 9.2.2.4.
*
* @author Mamadou Diop <diopmamadou(at)doubango.org>
*
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/
#include "tinySMS/tpdu/tsms_tpdu_command.h"
//=================================================================================================
// SMS TPDU SMS-COMMAND object definition
//
static tsk_object_t* tsms_tpdu_command_create(tsk_object_t * self, va_list * app)
{
tsms_tpdu_command_t *command = self;
if(command){
//tsk_bool_t orig = va_arg(*app, tsk_bool_t);
TSMS_TPDU_MESSAGE(command)->mti = tsms_tpdu_mti_command_mo;
}
return self;
}
static tsk_object_t* tsms_tpdu_command_destroy(tsk_object_t * self)
{
tsms_tpdu_command_t *command = self;
if(command){
}
return self;
}
static const tsk_object_def_t tsms_tpdu_command_def_s =
{
sizeof(tsms_tpdu_command_t),
tsms_tpdu_command_create,
tsms_tpdu_command_destroy,
tsk_null,
};
const tsk_object_def_t *tsms_tpdu_command_def_t = &tsms_tpdu_command_def_s;

View File

@ -0,0 +1,156 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsms_tpdu_submit.c
* @brief SMS TPDU SMS-SUBMIT message as per 3GPP TS 23.040 section 9.2.2.2.
*
* @author Mamadou Diop <diopmamadou(at)doubango.org>
*
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/
#include "tinySMS/tpdu/tsms_tpdu_submit.h"
#include "tsk_memory.h"
#include "tsk_debug.h"
int tsms_tpdu_submit_serialize(const tsms_tpdu_submit_t* self, const tsk_buffer_t* output)
{
uint8_t _1byte;
/* SMSC address */
#if TSMS_TPDU_APPEND_SMSC
//address addr_smsc(this->smsc, true);
//result.append(addr_smsc.getString());
#endif
/* SMS-SUBMIT first Octect:
- TP-Message-Type-Indicator(2b)
- TP-Reject-Duplicates(1b)
- TP-Validity-Period-Format(1b)
- TP-Reply-Path(1b)
- TP-User-Data-Header-Indicator(1b)
- TP-Status-Report-Request(1b)
*/
_1byte = (TSMS_TPDU_MESSAGE(self)->mti & 0xF3); /*2b*/
_1byte |= ((uint8_t)self->rd) << 2; /*1b*/
_1byte |= ((uint8_t)self->vpf) << 3; /*1b*/
_1byte |= ((uint8_t)self->rp) << 4; /*1b*/
_1byte |= ((uint8_t)self->udhi) << 5; /*1b*/
_1byte |= ((uint8_t)self->srr) << 6; /*1b*/
tsk_buffer_append(output, &_1byte, 1);
/* 3GPP TS 23.040 ==> 9.2.3.6 TP-Message-Reference (TP-MR) */
tsk_buffer_append(output, &self->mr, 1); /*0-255 ==> 1o*/
/* 3GPP TS 23.040 ==> 9.2.3.8 TP-Destination-Address (TP-DA) */
//address addr_desta(this->remote, false);
//result.append(addr_desta.getString());
/* GSM 03.40 ==> 9.2.3.9 TP-Protocol-Identifier (TP-PID) */
tsk_buffer_append(output, &self->pid, 1); /*1o*/
/* 3GPP TS 23.040 ==> 9.2.3.10 TP-Data-Coding-Scheme (TP-DCS) */
tsk_buffer_append(output, &self->dcs, 1); /*1o*/
/* 3GPP TS 23.040 ==> 9.2.3.12 TP-Validity-Period
* Only TP-VP (Relative format) is supported. 1o
*/
tsk_buffer_append(output, &self->vp, 1); /*1o*/
/* 3GPP TS 23.040 ==> 9.2.3.16 TP-User-Data-Length (TP-UDL)
* (alpha = SMS_ALPHA_7bit) ==> number of septets.
* ((alpha == SMS_ALPHA_8bit) || (alpha == SMS_ALPHA_UCS2)) ==> number of octes.
*/
// result.append(b10_to_b16(this->userdata.length()/2)); ==> see the switch below
// this->userdata ==> The ascii string to send/encode
/* 3GPP TS 23.040 ==> 9.2.3.24 TP-User Data (TP-UD) */
switch(this->alpha)
{
case SMS_ALPHA_7bit:
{
string pdu;
ascii_to_pdu(this->userdata, pdu);
result.append(b10_to_b16(this->userdata.length())); /* TP-UDL */
result.append(pdu); /* TP-UD */
}
break;
case SMS_ALPHA_8bit:
{
string bit8;
ascii_to_bit8(this->userdata, bit8);
result.append(b10_to_b16(bit8.length()/2)); /* TP-UDL */
result.append(bit8); /* TP-UD */
}
break;
case SMS_ALPHA_UCS2:
{
string ucs2;
ascii_to_ucs2(this->userdata, ucs2);
result.append(b10_to_b16(ucs2.length()/2)); /* TP-UDL */
result.append(ucs2); /* TP-UD */
}
break;
default:
throw "Unsupported alphabet";
}
return result;
}
//=================================================================================================
// SMS TPDU SMS-COMMAND object definition
//
static tsk_object_t* tsms_tpdu_submit_create(tsk_object_t * self, va_list * app)
{
tsms_tpdu_submit_t *submit = self;
if(submit){
//tsk_bool_t orig = va_arg(*app, tsk_bool_t);
TSMS_TPDU_MESSAGE(submit)->mti = tsms_tpdu_mti_submit_mo;
TSMS_TPDU_MESSAGE(submit)->serialize = TSMS_TPDU_MESSAGE_SERIALIZE_F(tsms_tpdu_submit_serialize);
}
return self;
}
static tsk_object_t* tsms_tpdu_submit_destroy(tsk_object_t * self)
{
tsms_tpdu_submit_t *submit = self;
if(submit){
TSK_FREE(submit->ud);
}
return self;
}
static const tsk_object_def_t tsms_tpdu_submit_def_s =
{
sizeof(tsms_tpdu_submit_t),
tsms_tpdu_submit_create,
tsms_tpdu_submit_destroy,
tsk_null,
};
const tsk_object_def_t *tsms_tpdu_submit_def_t = &tsms_tpdu_submit_def_s;

Binary file not shown.

View File

@ -0,0 +1,26 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
#ifndef TEST_SMS_STDAFX_H
#define TEST_SMS_STDAFX_H
#ifdef WIN32
#include "targetver.h"
#endif
#include <stdio.h>
#if (defined(_WIN32) || defined(WIN32) || defined(_WIN32_WCE)) && !defined(__SYMBIAN32__)
#include <tchar.h>
#endif
// TODO: reference additional headers your program requires here
#include <string.h>
#endif /* TEST_SMS_STDAFX_H */

Some files were not shown because too many files have changed in this diff Show More