π
<-
Chat plein-écran
[^]

Are Calc-To-Calc Connections Possible Using Ndless?

C, C++, ASM...

Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby catastropher » 28 Dec 2017, 20:02

Hey guys! If possible, I'd really like to get multiplayer working with X3D. I tried writing a small USB driver test (and registered it with usb_register_driver), but none of the match, attach, or detach functions ever seem to get called. Granted, I didn't make it a resident program because I'd like to have the driver run in-game. Does USB functionality get disabled when running an ndless program? Does anyone have an idea how I might go about implementing bidirectional calc-to-calc communication? Thanks!
User avatar
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 68%
 
Posts: 13
Joined: 30 Sep 2015, 18:05
Gender: Male
Calculator(s):
MyCalcs profile

Re: Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby Vogtinator » 28 Dec 2017, 20:19

The OS has to be running for the communication with USB peripherals to work.
This means you'll have to re-enable IRQs and share the devices with other parts of the OS.

Not much is known about the gadget-side USB stack. It's probably based on some ancient version of https://www.jungo.com/st/products/usb-device-stack/

It's probably the best option to only use the NavNet API for communication. There's some code on https://github.com/compujuckel/nsocket/ ... /nsocket.c and documentation on hackspire: https://hackspire.org/index.php/Syscalls#NavNet
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Re: Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby catastropher » 28 Dec 2017, 20:34

Thank you very much! Is NavNet still broken for calc-to-calc communication? If so I'm thinking that I could have a PC-side server that just relays packets between the calcs. Thanks for such a quick response!
User avatar
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 68%
 
Posts: 13
Joined: 30 Sep 2015, 18:05
Gender: Male
Calculator(s):
MyCalcs profile

Re: Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby Vogtinator » 28 Dec 2017, 20:47

NavNet should work fine between calcs as you can send files without issues.
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Re: Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby catastropher » 28 Dec 2017, 23:17

For some reason, NavNet seems to cause a reboot on the Nspire classic when calling TI_NN_NodeEnumInit(). I'm running OS 3.9.0.463 with Ndless 4.4. I'm using the code you linked to for nsocket. It seems to work on the CX though. Do you have any idea what the problem could be?
User avatar
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 68%
 
Posts: 13
Joined: 30 Sep 2015, 18:05
Gender: Male
Calculator(s):
MyCalcs profile

Re: Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby Vogtinator » 28 Dec 2017, 23:30

catastropher wrote:For some reason, NavNet seems to cause a reboot on the Nspire classic when calling TI_NN_NodeEnumInit(). I'm running OS 3.9.0.463 with Ndless 4.4. I'm using the code you linked to for nsocket. It seems to work on the CX though. Do you have any idea what the problem could be?


It looks like the syscalls were never added for OS 3.9.x:

Code: Select all
Warning: Syscall 'TI_NN_NodeEnumInit' not found in 'OS_ncas-3.9.0.idc'!
Warning: Syscall 'TI_NN_NodeEnumInit' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_NodeEnumInit' not found in 'OS_ncascx-3.9.1.idc'!
Warning: Syscall 'TI_NN_NodeEnumInit' not found in 'OS_cascx-3.9.1.idc'!


If you'd like to have those, just report which set of syscalls you need for which OSs and I can try to fix that.
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Re: Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby catastropher » 28 Dec 2017, 23:41

Just looking over the nsocket source code, it looks like it uses the following syscalls:

Code: Select all
TI_NN_CreateOperationHandle
TI_NN_NodeEnumInit
TI_NN_NodeEnumNext
TI_NN_NodeEnumDone
TI_NN_DestroyOperationHandle
TI_NN_Connect
TI_NN_Write
TI_NN_Read
TI_NN_GetConnMaxPktSize
TI_NN_Disconnect


Would it be possible to add those for CAS OS 3.9.0? I'm not sure which are missing, as it never got past the TI_NN_NodeEnumInit(). I believe TI_NN_CreateOperationHandle() worked though. Thank you!
User avatar
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 68%
 
Posts: 13
Joined: 30 Sep 2015, 18:05
Gender: Male
Calculator(s):
MyCalcs profile

Re: Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby Vogtinator » 29 Dec 2017, 00:04

Attached is a ndless_resources with the missing TI_NN_ syscalls added.

TI_NN_GetConnMaxPktSize doesn't seem to be there anymore, I assume it got inlined by the compiler. I assume you can just use whatever works instead of that function.

This is the current MakeSyscalls output for OS 3.9.0 CAS:
Code: Select all
Warning: Syscall 'TI_NN_SendKeyPress' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_GetConnMaxPktSize' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_StartService' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_StopService' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_UnregisterNotifyCallback' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_RegisterNotifyCallback' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_InstallOS' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_GetNodeInfo' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_GetNodeScreen' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_CopyFile' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_Rename' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_RmDir' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_MkDir' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_DeleteFile' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_GetFileAttributes' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_PutFile' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_DirEnumDone' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_DirEnumNext' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_DirEnumInit' not found in 'OS_cas-3.9.0.idc'!
Warning: Syscall 'TI_NN_GetFile' not found in 'OS_cas-3.9.0.idc'!
Attachments
ndless_resources.tns
(198.32 KiB) Downloaded 125 times
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Re: Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby catastropher » 29 Dec 2017, 18:19

Thank you! That fixed the crash from those system calls and I was able to transfer data from the calc to the computer. However, I'm unable to transfer anything back to the calc. I suspect this is because I don't have a service running on the calc to accept the packets. As is my luck, the system calls to start and stop a service cause a crash as well xD When you get the chance, could you also add TI_NN_StartService() and TI_NN_StopService()? I'd need them for a CX regular running 4.5.0.1180 and a classic CAS running 3.9.0. I'm really sorry, I wish I would have known I needed them when you added the others. Thank you so much, I really appreciate all of your help!!!
User avatar
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 68%
 
Posts: 13
Joined: 30 Sep 2015, 18:05
Gender: Male
Calculator(s):
MyCalcs profile

Re: Are Calc-To-Calc Connections Possible Using Ndless?

Unread postby Vogtinator » 29 Dec 2017, 19:06

The attached ndless_resources.tns should contain TI_NN_{Stop,Start}Service for 3.9.0 CAS and all 4.x until 4.5.0.

Turns out the function was still there, just under a different name, so I just created an alias.
Attachments
ndless_resources.tns
(198.32 KiB) Downloaded 121 times
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Next

Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: No registered users and 16 guests

-
Search
-
Social TI-Planet
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1511 utilisateurs:
>1499 invités
>7 membres
>5 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)