You Are Here:

Community: Developer Discussion Boards

Reply « Previous Thread | Next Thread »

#1 Old import aosocketnativenew - how? - 2007-02-11, 06:32

Join Date: Feb 2007
Posts: 4
chiuming07
Offline
Registered User
i need to make use of the aosocketnativenew.pyd

how can i import it to my program?

when I run the application that import aosocketnativenew, I got an error

do I put aosocketnativenew.pyd in some directory? -OR- i need to build a .SIS file?

thanks
Reply With Quote

#2 Old Re: import aosocketnativenew - how? - 2007-02-11, 12:03

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Which phone do you have? There does not seem to be a version of aosocketnativenew for 3rd Edition phones.
Reply With Quote

#3 Old Re: import aosocketnativenew - how? - 2007-02-11, 14:57

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Hi chiuming07,

Could you please be more accurate with the error code you get.

Are you using a 2nd or 3rd edition platform devices?

For a 2nd edition device you need to put binaries and python libraries in c:\system\Libs or e:\system\Libs

For a 3rd edition device binary modules have to be put in c:\sys\bin\ and python libraries in c:\resource\.

Now for 3rd edition platform you can't just import a binary with "import aosocketnativenew" like it used to be with second edition platform.

To have the same behavior in both 2nd and 3rd edition platforms, we use now 2 files, the binary file (starting with "_" so here _aosocketnativenew.pyd) and and Python files to launch the binary.

Like I mentioned before you put the binary in !:\system\Libs or c:\sys\bin\. Then you create a file which has the name you want for your library so here aosocketnativenew.py and inside you put the content below:

Code:
import e32

if e32.s60_version_info>=(3,0):
    import imp
    _aosocketnativenew= imp.load_dynamic('_aosocketnativenew', 'c:\\sys\\bin\\_aosocketnativenew.pyd')
    del imp 

else:
    import _aosocketnativenew

del e32#remove unnecessary names from namespace
from _aosocketnativenew import *
del _aosocketnativenew
Like this you always have 2 files for both editions just the directories change.

That should solve your problem I think.

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#4 Old Re: import aosocketnativenew - how? - 2007-02-11, 15:37

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Quote:
Originally Posted by lfd
Like this you always have 2 files for both editions just the directories change.

That should solve your problem I think.
Except that 3rd Edition phones are unable to load DLLs compiled for older versions of Symbian. The file format has changed between Symbian pre-v9 and later.

I looked around and could not find a a version of asocketnativenew for 3rd Edition.
Reply With Quote

#5 Old Re: import aosocketnativenew - how? - 2007-02-11, 15:59

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Absolutely

If no 3rd edition module, can we have the source somewhere? I could try to port it.

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#6 Old Re: import aosocketnativenew - how? - 2007-02-12, 17:15

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Quote:
Originally Posted by lfd
Absolutely

If no 3rd edition module, can we have the source somewhere? I could try to port it.

LFD
You can found source code from aosocketnativenew in the PDIS site.
They provide 2nd and 2nd FP2 source code. Perhaps could you port it to 3rd ?
Albert Huang made a new version of aosocketnativenew flushing the device cache but source changes are not available

link :
aosocketnativenew in the PDIS 0.10 source tree
aosocketnativenew from Albert Huang

Cyke64


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#7 Old Re: import aosocketnativenew - how? - 2007-02-15, 18:55

Join Date: Feb 2007
Posts: 3
Location: NY USA
Send a message via AIM to Faultsprofit Send a message via MSN to Faultsprofit
Faultsprofit
Offline
Registered User
Has anyone made further progress on the pdis/aosocket port? My feeble attempts at this have been unsuccessful. Is this still an active issue?
Reply With Quote

#8 Old Re: import aosocketnativenew - how? - 2007-02-22, 22:08

Join Date: Jan 2007
Posts: 80
federico2929
Offline
Regular Contributor
Has anybody had luck in this?
Reply With Quote

#9 Old Re: import aosocketnativenew - how? - 2007-05-24, 17:48

Join Date: May 2007
Posts: 19
mwibbels
Offline
Registered User
Don't know if you still need it (or if anybody is watching) but I've made a version for 3rd edition. Note: it is unsigned. You should sign it using the same certificate and capabilities that you used for Python itself.

You can download the SIS file here:

http://contextwatcher.lab.telin.nl/C.../Software.aspx
Reply With Quote

#10 Old Re: import aosocketnativenew - how? - 2007-05-24, 19:11

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Quote:
Originally Posted by mwibbels
Don't know if you still need it (or if anybody is watching) but I've made a version for 3rd edition. Note: it is unsigned. You should sign it using the same certificate and capabilities that you used for Python itself.

You can download the SIS file here:

http://contextwatcher.lab.telin.nl/C.../Software.aspx
Welcome to Python forum

It's great news that you have ported the aosocketnativenew.pyd to 3rd But could you publish the source code (if possible !) ?
But you forget to announce the nice locationrequestor.pyd which implements the location API on the same page

Thanks

Cyke64


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#11 Old Re: import aosocketnativenew - how? - 2007-05-24, 20:50

Join Date: May 2007
Posts: 19
mwibbels
Offline
Registered User
Quote:
Originally Posted by cyke64
Welcome to Python forum

It's great news that you have ported the aosocketnativenew.pyd to 3rd But could you publish the source code (if possible !) ?
But you forget to announce the nice locationrequestor.pyd which implements the location API on the same page

Thanks

Cyke64
Thanks for the welcome message

Sure, I'll put the sources there, may take a little time as the update rate of that site isn't very high. But if you're in a hurry, I put the sources on a temporary location.


Please note that these sources are NOT mine, I only made these minimal changes:

dllentry.cpp: The E32Dll entry point is obsolete for 3rd edition (EKA2):

Code:
#ifndef EKA2
GLDEF_C TInt E32Dll(TDllReason)
	{
	return KErrNone;
	}
#endif
moduleinit.cpp: Python extension loading changed, so first lines of initaosocketnativenew should be:

Code:
	#ifdef EKA2
    // 3rd edition, use _aosocketnativenew for separate python loader
	PyObject* module = Py_InitModule(
		"_aosocketnativenew", // module name
		const_cast<PyMethodDef*>(&apn_methods[0]));
	#else
	// 2nd edition, no loader
	PyObject* module = Py_InitModule(
		"aosocketnativenew", // module name
		const_cast<PyMethodDef*>(&apn_methods[0]));
	#endif
asocketnativenew.py: a Python 'loader' which is very standard:

Code:
import e32

if e32.s60_version_info>=(3,0):
    import imp
    _aosocketnativenew=imp.load_dynamic('_aosocketnativenew', 'c:\\sys\\bin\\_aosocketnativenew.pyd')
    
else:
    import _aosocketnativenew

del e32, imp #remove unnecessary names from namespace
from _aosocketnativenew import *
del _aosocketnativenew
And presto! Oh, I also changed the .pkg file of course. Note that there's an absolute path to the Symbian SDK (I'm lazy, sorry).
Reply With Quote

#12 Old Re: import aosocketnativenew - how? - 2007-05-30, 20:34

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Hello Mwibbels

Could you please change your profile for receiving email from Forum Nokia ? I can't contact you
We have a problem with the other library : LocationRequestor It would be a great library only if it works
But other people try to use it but they can't
Could you please correct the source code ?
Thanks
Cyke64

Quote:
Originally Posted by mwibbels
Thanks for the welcome message

Sure, I'll put the sources there, may take a little time as the update rate of that site isn't very high. But if you're in a hurry, I put the sources on a temporary location.


Please note that these sources are NOT mine, I only made these minimal changes:

dllentry.cpp: The E32Dll entry point is obsolete for 3rd edition (EKA2):

Code:
#ifndef EKA2
GLDEF_C TInt E32Dll(TDllReason)
	{
	return KErrNone;
	}
#endif
moduleinit.cpp: Python extension loading changed, so first lines of initaosocketnativenew should be:

Code:
	#ifdef EKA2
    // 3rd edition, use _aosocketnativenew for separate python loader
	PyObject* module = Py_InitModule(
		"_aosocketnativenew", // module name
		const_cast<PyMethodDef*>(&apn_methods[0]));
	#else
	// 2nd edition, no loader
	PyObject* module = Py_InitModule(
		"aosocketnativenew", // module name
		const_cast<PyMethodDef*>(&apn_methods[0]));
	#endif
asocketnativenew.py: a Python 'loader' which is very standard:

Code:
import e32

if e32.s60_version_info>=(3,0):
    import imp
    _aosocketnativenew=imp.load_dynamic('_aosocketnativenew', 'c:\\sys\\bin\\_aosocketnativenew.pyd')
    
else:
    import _aosocketnativenew

del e32, imp #remove unnecessary names from namespace
from _aosocketnativenew import *
del _aosocketnativenew
And presto! Oh, I also changed the .pkg file of course. Note that there's an absolute path to the Symbian SDK (I'm lazy, sorry).


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#13 Old Re: import aosocketnativenew - how? - 2007-05-30, 20:36

Join Date: May 2007
Posts: 19
mwibbels
Offline
Registered User
Hmm. I received this message ok. But I'll change my profile. What seems to be the problem with the sources? (we're actively using this library ...)

Quote:
Originally Posted by cyke64
Hello Mwibbels

Could you please change your profile for receiving email from Forum Nokia ? I can't contact you
We have a problem with the other library : LocationRequestor It would be a great library only if it works
But other people try to use it but they can't
Could you please correct the source code ?
Thanks
Cyke64
Reply With Quote

#14 Old Re: import aosocketnativenew - how? - 2008-03-03, 20:26

Join Date: Mar 2007
Posts: 5
phonegnome
Offline
Registered User
I got the aosocket_unsigned.sis file from http://www.iyouit.eu/portal/software/ and signed it, but I still need a version of pdis.sis for 3rd edition.

Apps that use aosocket need pdis, or at least when I run a script that has:
Code:
    import aosocketnativenew
    from aosocket.symbian.bt_device_discoverer import *
It gets an Import error "No module named pdis.lib.logging"

Can a PDIS.SIS be built for 3rd edition using ensymble? If so, how?
Reply With Quote

#15 Old Re: import aosocketnativenew - how? - 2008-03-06, 13:03

Join Date: May 2007
Posts: 19
mwibbels
Offline
Registered User
The thing is: we only ported aosocket, since we use only a small portion of it that does not require pdis. We did not port pdis and I've got no idea whether or not that would be easy.

Sorry that I can't be of any more help.

Martin
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
J2Se Obex Server to receive files alam.sher Bluetooth Technology 22 2008-07-17 14:49
GoogleIt deepika.mangla General Symbian C++ 4 2007-01-08 02:07
SyExpat + problem + memmove + Carbide Express pearman General Symbian C++ 2 2006-10-14 23:21
DemoDMServer SMS problem kudelasz OMA DM/DS/CP 17 2006-05-22 10:16
SocketConnection Work on 6600&Emulators BUT NOT IN 6680 eerant Mobile Java Networking & Messaging & Security 4 2006-03-11 01:35

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia