π
<-
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):

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 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 78.9%
 
Posts: 186
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):

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):

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 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 78.9%
 
Posts: 186
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):

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):

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 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 78.9%
 
Posts: 186
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):

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):

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 76 times
User avatar
VogtinatorPremium
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 78.9%
 
Posts: 186
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):

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):

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 70 times
User avatar
VogtinatorPremium
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 78.9%
 
Posts: 186
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):

Next

Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: No registered users and 3 guests

-
Search
-
Social
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Remplace ton ancienne fx-92 Collège ou Graph 35 par la Graph 90+E couleur. Pour tout achat, Casio te rembourse 10€ en cas de retour de ta fx-92 Collège, ou 15€ en cas de retour de ta Graph 35. Etiquette de retour fournie, pas de frais de port à payer, même les anciens modèles et machines non fonctionnelles sont acceptées. En partenariat avec les Restos du coeur.
10€ remboursés par Casio sur l'achat de ta calculatrice Graph 35 d'ici le 30 Septembre 2021
Reprise de ton ancienne fx-92 Collège à 5€ ou Graph 35 à 10€. Même non fonctionnelle ou ancien modèle. Etiquette de retour fournie, pas de frais de port à payer. En partenariat avec les Restos du coeur.
25€ remboursés par Casio sur l'achat de ta calculatrice fx-CP400 d'ici le 31 Octobre 2021
3€ remboursés par Casio sur l'achat de ta calculatrice fx-92 Collège d'ici le 30 Septembre 2021
Coque NumWorks édition limitée Août 2021 à gagner.
Découvre les nouvelles fonctionnalités en Python de l'OS 5.5 pour la 83PCE/84+C-T Python Edition
Découvre les nouvelles fonctionnalités en Python de l'OS 5.2 pour les Nspire CX II
Omega, le fork étendant les capacités de ta NumWorks, même en mode examen !
12345678910
-
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.
600 utilisateurs:
>582 invités
>14 membres
>4 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)