
18th July 2003, 08:10 AM
|
Junior Member - OP
Thanks Meter 0
Posts: 24
Join Date: Jul 2003
|
RIL ERROR: LNK2019
Hi,
I tried so compile the RIL-Sample in my vEmbeddedC++.
The Workspace is the original from this website, no modifications.
Every time i try to compile and send to my MDA i get the following error:
Quote:
Linking...
tstril.obj : error LNK2019: unresolved external symbol RIL_Initialize referenced in function "unsigned long __cdecl DoRIL(void *)" (?DoRIL@@YAKPAX@Z)
ARMRel/tstril.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
tstril.exe - 2 error(s), 0 warning(s)
|
If I try other own projects, there is no problem to send and start to/on MDA. The compiled ARM-Release also works.
Would be great, if anyone of you has got a tip, where's my fault.
Greetings from hannovre,
Andreas
|

18th July 2003, 08:48 AM
|
Developer / Recognized Developer
Thanks Meter 2
Posts: 652
Join Date: Mar 2003
Location: delft 52'00N 4'22E
|
that is because there is no ril.lib, you will either have to create it your self,
or use another method to get pointers to the ril.dll.
I usually use something like this:
-------rillib.h
Code:
typedef HRESULT (*PFRIL_Initialize)(DWORD dwIndex, RILRESULTCALLBACK pfnResult, RILNOTIFYCALLBACK pfnNotify,
DWORD dwNotificationClasses, DWORD dwParam, HANDLE *phRil);
typedef HRESULT (*PFRIL_DeInitialize)(HANDLE hRil);
typedef HRESULT (*PFRIL_GetRegistrationStatus)(HANDLE hRil);
typedef HRESULT (*PFRIL_GetCellTowerInfo)(HANDLE hRil);
typedef HRESULT (*PFRIL_DevSpecific)(HANDLE hRil, BYTE*params, DWORD dwSize);
extern PFRIL_Initialize RIL_Initialize;
extern PFRIL_GetRegistrationStatus RIL_GetRegistrationStatus;
extern PFRIL_GetCellTowerInfo RIL_GetCellTowerInfo;
extern PFRIL_DevSpecific RIL_DevSpecific;
---------rillib.c
Code:
#include "rillib.h"
PFRIL_Initialize RIL_Initialize;
PFRIL_GetRegistrationStatus RIL_GetRegistrationStatus;
PFRIL_GetCellTowerInfo RIL_GetCellTowerInfo;
PFRIL_DevSpecific RIL_DevSpecific;
class RilLib {
public:
RilLib()
{
m_hRilDll= LoadLibrary(L"ril.dll");
RIL_Initialize= (PFRIL_Initialize)GetProcAddress(m_hRilDll, L"RIL_Initialize");
RIL_GetRegistrationStatus= (PFRIL_GetRegistrationStatus)GetProcAddress(m_hRilDll, L"RIL_GetRegistrationStatus");
RIL_GetCellTowerInfo= (PFRIL_GetCellTowerInfo)GetProcAddress(m_hRilDll, L"RIL_GetCellTowerInfo");
RIL_DevSpecific= (PFRIL_DevSpecific)GetProcAddress(m_hRilDll, L"RIL_DevSpecific");
}
~RilLib()
{
RIL_Initialize= NULL;
RIL_GetRegistrationStatus= NULL;
RIL_GetCellTowerInfo= NULL;
RIL_DevSpecific= NULL;
FreeLibrary(m_hRilDll);
}
private:
HMODULE m_hRilDll;
};
static RilLib g_rillib;
|

18th July 2003, 10:39 AM
|
Senior Member
Thanks Meter 0
Posts: 137
Join Date: Jan 2003
Location: Earth... I think
|
Quote:
|
Originally Posted by XDA developer Itsme
that is because there is no ril.lib, you will either have to create it your self,
or use another method to get pointers to the ril.dll.
|
The ril.lib is in the tstril directory. you need to include it in the project. The Readme.txt describes how to create a ril.lib from any ril.dll
W4XY
|

21st July 2003, 10:47 AM
|
Junior Member - OP
Thanks Meter 0
Posts: 24
Join Date: Jul 2003
|
Many thanks, I've included the RIL and now it seems to work.
A short question to the ExampleProgramm is left: In which format ist the SMS-Message? Hex? Exists a routine to decode the SMS to readable text?
Greetings,.
Andreas :o)
|

21st July 2003, 12:33 PM
|
Junior Member
Thanks Meter 0

Posts: 18
Join Date: Jan 2003
Location: Huddersfield UK
|
Hi ballrock2
This code will decipher the incoming byte stream. It's not particularly elegant but it seems to work, (I've not included error checking etc)
Code:
unsigned char byteflip(unsigned char inchar)
{
unsigned char outchar;
unsigned char tmp;
int i;
outchar = 0;
for (i = 0; i < 8; i++)
{
tmp = inchar & 1; // get lsb in tmp
inchar >>= 1; // shift right
outchar = (outchar << 1) | tmp;
}
return outchar;
}
TCHAR *msgdecipher(unsigned char *data, int n)
{
unsigned char ybuf[1000]; // buffer of byteflipped data
unsigned char tmp; // temporary character
static TCHAR xbuf[1000]; // output unicode buffer
int i; // index into inconimg and output character stream
int j; // index into flipped bytestream
int k; // counter for each bit in 7 bit character
int l; // counter to know when to increment j
int escape; // set true when esc (1b) encountered in output stream
TCHAR *p; // pointer to output buffer
p=xbuf;
// byteflip each input char and store in ybuf
for (i = 0; i < n; i++)
{
ybuf[i] = byteflip(data[i]);
}
// read each 7 bits from ybuf, create a character and re-flip
j = 0;
k = 0;
l = 0;
escape = 0;
for (i = 0; i < n; i++) // loop for each output character
{
tmp = 0;
for (k = 0; k < 7; k++)
{
tmp <<= 1;
if (ybuf[j] & 128)
{
tmp |= 1;;
}
ybuf[j] <<= 1;
l++;
if (l == 8) // when 8 bits read, go onto next char in bytestream
{
j++;
l = 0;
}
}
// shift left, so that when re-flipped, msb is zero
tmp = byteflip(tmp<<1);
// handle special and accented characters
// normal ascii drops straight through
if (tmp == 27)
{
escape = 1; // set flag and get next character
}
else
{
if (escape)
{
escape = 0;
switch (tmp)
{
case 20:
tmp = '^';
break;
case 40:
tmp = '{';
break;
case 41:
tmp = '}';
break;
case 47:
tmp = '\\';
break;
case 60:
tmp = '[';
break;
case 61:
tmp = '~';
break;
case 62:
tmp = ']';
break;
case 64:
tmp = '|';
break;
}
}
else
{
switch (tmp)
{
case 0:
tmp = '@';
break;
case 1:
tmp = '£';
break;
case 2:
tmp = '$';
break;
case 3:
tmp = '¥';
break;
case 4:
tmp = 'ê';
break;
case 5:
tmp = 'é';
break;
case 6:
tmp = 'ù';
break;
case 7:
tmp = 'ì';
break;
case 8:
tmp = 'ò';
break;
case 9:
tmp = 'ç';
break;
case 11:
tmp = 'Ø';
break;
case 12:
tmp = 'ø';
break;
case 14:
tmp = 'Å';
break;
case 15:
tmp = 'å';
break;
case 17:
tmp = '_';
break;
case 28:
tmp = 'Æ';
break;
case 29:
tmp = 'æ';
break;
case 30:
tmp = 'ß';
break;
case 31:
tmp = 'É';
break;
case 64:
tmp = '¡';
break;
case 91:
tmp = 'Ä';
break;
case 92:
tmp = 'Ö';
break;
case 93:
tmp = 'Ñ';
break;
case 94:
tmp = 'Ü';
break;
case 95:
tmp = '§';
break;
case 96:
tmp = '¿';
break;
case 123:
tmp = 'ä';
break;
case 124:
tmp = 'ö';
break;
case 125:
tmp = 'ñ';
break;
case 126:
tmp = 'ü';
break;
case 127:
tmp = 'à';
break;
}
}
p += _sntprintf(p, 2, TEXT("%c"),tmp);
}
}
return xbuf;
}
Regards
Malcolm Germain
|

23rd July 2003, 10:19 AM
|
Junior Member - OP
Thanks Meter 0
Posts: 24
Join Date: Jul 2003
|
Many many thanks!!! :o)
It works! ;o) If someone would like to get the project (Receiving SMS in "readbable" format), pse mail me.
I'm now searching for a way to send SMS ;o)
|

23rd July 2003, 10:32 AM
|
Junior Member
Thanks Meter 0

Posts: 18
Join Date: Jan 2003
Location: Huddersfield UK
|
Sending is even easier
Look at SmsOpen SmsSendMessage and SmsClose in the documentation
Code:
#include <sms.h>
long fnSendSMS(LPCTSTR inaddr,LPCTSTR inmsg)
{
HRESULT res, res2;
LPCTSTR ptsMessageProtocol;
SMS_HANDLE psmshHandle;
SMS_ADDRESS psmsaDestinationAddress;
TEXT_PROVIDER_SPECIFIC_DATA tpsd;
SMS_MESSAGE_ID msgid;
ptsMessageProtocol = _T("Microsoft Text SMS Protocol");
res = SmsOpen(ptsMessageProtocol,SMS_MODE_SEND, &psmshHandle,NULL);
psmsaDestinationAddress.smsatAddressType = SMSAT_INTERNATIONAL;
wcscpy(psmsaDestinationAddress.ptsAddress ,inaddr);
tpsd.dwMessageOptions = PS_MESSAGE_OPTION_NONE;
tpsd.psMessageClass = PS_MESSAGE_CLASS1;
tpsd.psReplaceOption = PSRO_NONE;
res = SmsSendMessage(
psmshHandle,
NULL,
&psmsaDestinationAddress,
NULL,
(BYTE *)inmsg,
wcslen(inmsg) * 2,
(unsigned char *)&tpsd,
sizeof(tpsd),
SMSDE_OPTIMAL,
SMS_OPTION_DELIVERY_NONE,
&msgid);
res2 = SmsClose(psmshHandle);
return long(res);
}
Regards
Malcolm Germain
|

30th July 2003, 05:33 PM
|
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Jul 2003
|
Is there a way to send PDU data instead of TEXT data.
I would like to send EMS messages (text + picture) using RIL.
EMS is like SMS but with specific data header (TP-UDH) and content (TP-UD).
I need to send a complete PDU packet (as with AT+CMGF=0 when using a GSM modem).
For ptsMessageProtocol what are all supported values ?
That could be possible, because EzWap 2.5 is able to send MMS messages with XDA (need to send PDU data by SMS too).
Any idea ?
Thanks,
Jeronimo
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
Go to top of page...
|
|
|
|