Are Calc-To-Calc Connections Possible Using Ndless?
15 posts
• Page 1 of 2 • 1, 2
Are Calc-To-Calc Connections Possible Using Ndless?
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!
-
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)- Posts: 13
- Joined: 30 Sep 2015, 18:05
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Are Calc-To-Calc Connections Possible Using Ndless?
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
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
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Are Calc-To-Calc Connections Possible Using Ndless?
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!
-
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)- Posts: 13
- Joined: 30 Sep 2015, 18:05
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Are Calc-To-Calc Connections Possible Using Ndless?
NavNet should work fine between calcs as you can send files without issues.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Are Calc-To-Calc Connections Possible Using Ndless?
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?
-
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)- Posts: 13
- Joined: 30 Sep 2015, 18:05
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Are Calc-To-Calc Connections Possible Using Ndless?
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.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Are Calc-To-Calc Connections Possible Using Ndless?
Just looking over the nsocket source code, it looks like it uses the following syscalls:
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!
- 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!
-
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)- Posts: 13
- Joined: 30 Sep 2015, 18:05
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Are Calc-To-Calc Connections Possible Using Ndless?
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:
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'!
You do not have the required permissions to view the files attached to this post.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Are Calc-To-Calc Connections Possible Using Ndless?
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!!!
-
catastropherProgrammeur
Niveau 3: MH (Membre Habitué)- Posts: 13
- Joined: 30 Sep 2015, 18:05
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Are Calc-To-Calc Connections Possible Using Ndless?
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.
Turns out the function was still there, just under a different name, so I just created an alias.
You do not have the required permissions to view the files attached to this post.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
15 posts
• Page 1 of 2 • 1, 2
Return to Native: Ndless, Linux, ...
Who is online
Users browsing this forum: ClaudeBot [spider] and 5 guests