Android TV Launcher Pushed to Google Play

Over the past decade, the tech universe has seen two drastic and widely contrasting changes with … more

Cyngn, OnePlus, Micromax – The Legal Battle

Recently, a battle has been waging in India over the rights to distribute the commercial … more

Lean Mean Battery Power Saving App Review

We talk a lot about battery topics here at XDA TV. We talk about everything from Power Banks to USB … more

Android 5.1 Possibly Coming February 2015

Google released Android 5.0 just over a month ago, and since then Lollipop has been trying to … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

RIL ERROR: LNK2019

OP ballrock2

18th July 2003, 09:10 AM   |  #1  
OP Junior Member
Thanks Meter: 0
 
24 posts
Join Date:Joined: Jul 2003
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, 09:48 AM   |  #2  
Retired Admin
delft 52'00N 4'22E
Thanks Meter: 6
 
652 posts
Join Date:Joined: Mar 2003
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, 11:39 AM   |  #3  
Senior Member
Earth... I think
Thanks Meter: 1
 
137 posts
Join Date:Joined: Jan 2003
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
21st July 2003, 11:47 AM   |  #4  
OP Junior Member
Thanks Meter: 0
 
24 posts
Join Date:Joined: 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, 01:33 PM   |  #5  
Junior Member
Flag Huddersfield UK
Thanks Meter: 0
 
18 posts
Join Date:Joined: Jan 2003
More
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 &#40;i = 0; i < 8; i++&#41;
	&#123;
		tmp = inchar & 1;		// get lsb in tmp
		inchar >>= 1;			// shift right
		outchar = &#40;outchar << 1&#41;  | tmp;	
	&#125;
	return outchar;
&#125;



TCHAR *msgdecipher&#40;unsigned char *data, int n&#41;
&#123;
	unsigned char ybuf&#91;1000&#93;;	// buffer of byteflipped data
	unsigned char tmp;			// temporary character
    static TCHAR xbuf&#91;1000&#93;;	// 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 &#40;1b&#41; encountered in output stream

    TCHAR *p;					// pointer to output buffer
    
	
	p=xbuf;


	// byteflip each input char and store in ybuf

	for &#40;i = 0; i < n; i++&#41;
	&#123;
		ybuf&#91;i&#93; = byteflip&#40;data&#91;i&#93;&#41;;
	&#125;

	
	// read each 7 bits from ybuf, create a character and re-flip

	j = 0;
	k = 0;
	l = 0;
	
	escape = 0;

	for &#40;i = 0; i < n; i++&#41;		// loop for each output character
	&#123;
		tmp = 0;
		for &#40;k = 0; k < 7; k++&#41;
		&#123;
			tmp <<= 1;
			if &#40;ybuf&#91;j&#93; & 128&#41;
			&#123;
				tmp |= 1;;
			&#125;
			ybuf&#91;j&#93; <<= 1;
			l++;
			if &#40;l == 8&#41;			// when 8 bits read, go onto next char in bytestream
			&#123;
				j++;
				l = 0;
			&#125;
		&#125;

		// shift left, so that when re-flipped, msb is zero

		tmp = byteflip&#40;tmp<<1&#41;;


		// handle special and accented characters

		// normal ascii drops straight through


		if &#40;tmp == 27&#41;
		&#123;
			escape = 1;		// set flag and get next character
		&#125;
		else
		&#123;
			if &#40;escape&#41;
			&#123;
				escape = 0;
				switch &#40;tmp&#41;
				&#123;
				case 20&#58;
					tmp = '^';
					break;
				case 40&#58;
					tmp = '&#123;';
					break;
				case 41&#58;
					tmp = '&#125;';
					break;
				case 47&#58;
					tmp = '\\';
					break;
				case 60&#58;
					tmp = '&#91;';
					break;
				case 61&#58;
					tmp = '~';
					break;
				case 62&#58;
					tmp = '&#93;';
					break;
				case 64&#58;
					tmp = '|';
					break;
				&#125;
			&#125;
			else
			&#123;

				switch &#40;tmp&#41;
				&#123;
				case 0&#58;
					tmp = '@';
					break;
				case 1&#58;
					tmp = '';
					break;
				case 2&#58;
					tmp = '$';
					break;
				case 3&#58;
					tmp = '';
					break;
				case 4&#58;
					tmp = '';
					break;
				case 5&#58;
					tmp = '';
					break;
				case 6&#58;
					tmp = '';
					break;
				case 7&#58;
					tmp = '';
					break;
				case 8&#58;
					tmp = '';
					break;
				case 9&#58;
					tmp = '';
					break;
				case 11&#58;
					tmp = '';
					break;
				case 12&#58;
					tmp = '';
					break;
				case 14&#58;
					tmp = '';
					break;
				case 15&#58;
					tmp = '';
					break;
				case 17&#58;
					tmp = '_';
					break;
				case 28&#58;
					tmp = '';
					break;
				case 29&#58;
					tmp = '';
					break;
				case 30&#58;
					tmp = '';
					break;
				case 31&#58;
					tmp = '';
					break;
				case 64&#58;
					tmp = '';
					break;
				case 91&#58;
					tmp = '';
					break;
				case 92&#58;
					tmp = '';
					break;
				case 93&#58;
					tmp = '';
					break;
				case 94&#58;
					tmp = '';
					break;
				case 95&#58;
					tmp = '';
					break;
				case 96&#58;
					tmp = '';
					break;
				case 123&#58;
					tmp = '';
					break;
				case 124&#58;
					tmp = '';
					break;
				case 125&#58;
					tmp = '';
					break;
				case 126&#58;
					tmp = '';
					break;
				case 127&#58;
					tmp = '';
					break;
				&#125;

			&#125;
			
			p += _sntprintf&#40;p, 2, TEXT&#40;"%c"&#41;,tmp&#41;;
			

		&#125;



	&#125;




    return xbuf;
&#125;
23rd July 2003, 11:19 AM   |  #6  
OP Junior Member
Thanks Meter: 0
 
24 posts
Join Date:Joined: 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, 11:32 AM   |  #7  
Junior Member
Flag Huddersfield UK
Thanks Meter: 0
 
18 posts
Join Date:Joined: Jan 2003
More
Sending is even easier

Look at SmsOpen SmsSendMessage and SmsClose in the documentation



Code:
#include <sms.h>

long fnSendSMS&#40;LPCTSTR inaddr,LPCTSTR inmsg&#41;
&#123;
HRESULT res, res2;
LPCTSTR  ptsMessageProtocol;
SMS_HANDLE  psmshHandle;
SMS_ADDRESS  psmsaDestinationAddress;
TEXT_PROVIDER_SPECIFIC_DATA tpsd;
SMS_MESSAGE_ID msgid;


    ptsMessageProtocol = _T&#40;"Microsoft Text SMS Protocol"&#41;;
	res = SmsOpen&#40;ptsMessageProtocol,SMS_MODE_SEND, &psmshHandle,NULL&#41;;

		psmsaDestinationAddress.smsatAddressType = SMSAT_INTERNATIONAL;
		wcscpy&#40;psmsaDestinationAddress.ptsAddress ,inaddr&#41;;
		tpsd.dwMessageOptions = PS_MESSAGE_OPTION_NONE;
		tpsd.psMessageClass = PS_MESSAGE_CLASS1;
		tpsd.psReplaceOption = PSRO_NONE;

	res = SmsSendMessage&#40;
		 psmshHandle,
		 NULL,
		 &psmsaDestinationAddress,
		 NULL,
		 &#40;BYTE *&#41;inmsg,
		 wcslen&#40;inmsg&#41; * 2,
		 &#40;unsigned char *&#41;&tpsd,
		 sizeof&#40;tpsd&#41;,
		 SMSDE_OPTIMAL,
		 SMS_OPTION_DELIVERY_NONE,
		 &msgid&#41;;

	
	res2 = SmsClose&#40;psmshHandle&#41;;
	return long&#40;res&#41;;
&#125;
30th July 2003, 06:33 PM   |  #8  
Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: 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,

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes