π
<-
Chat plein-écran
[^]

TI_NN_NodeEnumInit

C, C++, ASM...
En ligne

TI_NN_NodeEnumInit

Message non lude parisse » 09 Juin 2020, 14:42

I probably misunderstood something, I'm trying to connect the nspire with some USB device using this code
Code: Tout sélectionner
     
      nn_ch_t ch = NULL;
      nn_oh_t oh = NULL;
      nn_nh_t nh = NULL;
      oh = TI_NN_CreateOperationHandle();
      int ans=TI_NN_NodeEnumInit(oh);
      if (ans>=0){
   ans=TI_NN_NodeEnumNext(oh, &nh);
   if (ans>=0){
     TI_NN_NodeEnumDone(oh);
     TI_NN_DestroyOperationHandle(oh);
     ans=TI_NN_Connect(nh, 0x8001, &ch);
     if (ans>=0){
...

but the line int ans=TI_NN_NodeEnumInit(oh); fails to compile, while int ans=TI_NN_NodeEnumInit(ch); compiles.

The declaration of TI_NN_NodeEnumInit does not use the same argument type for the calc and for the device: for the calc it's nn_ch_t
Code: Tout sélectionner
include/syscall-decls.h:int16_t TI_NN_NodeEnumInit(nn_ch_t p1);
libsyscalls/stubs.cpp:int16_t TI_NN_NodeEnumInit(nn_ch_t p1);

for the PC it's nn_oh_t
Code: Tout sélectionner
NavNet/include/navnet.h:DLLDECL int16_t TI_NN_NodeEnumInit(nn_oh_t oh);

The PC declaration seems ok with the NavNet doc (https://hackspire.org/index.php?title=Syscalls#The_NavNet_API) while the calc declaration seems wrong:
nn_oh_t TI_NN_CreateOperationHandle(void): create an operation handle to be used with some NavNet functions.
int16_t TI_NN_DestroyOperationHandle(nn_oh_t oh): destroy an operation handle.
int16_t TI_NN_NodeEnumInit(nn_oh_t oh): initiates a node (computer or device) enumeration. Enumeration is required to find the partner computer or device.
...
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 77.8%
 
Messages: 3511
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: TI_NN_NodeEnumInit

Message non lude Mumflr Fumperdink » 10 Juin 2020, 16:59

I tried to figure out USB a while ago but kept getting stuck and confused. Can you show me your code if you get it working?
Avatar de l’utilisateur
Mumflr Fumperdink
Niveau 2: MI2 (Membre Initié)
Niveau 2: MI2 (Membre Initié)
Prochain niv.: 80%
 
Messages: 4
Inscription: 15 Jan 2019, 22:53
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

En ligne

Re: TI_NN_NodeEnumInit

Message non lude parisse » 10 Juin 2020, 17:36

I'm not trying anymore. I found another way to detect that the calculator is connected to a computer (I was not really interested in USB communication, just wanted to know if there was a connection).
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 77.8%
 
Messages: 3511
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: TI_NN_NodeEnumInit

Message non lude Adriweb » 10 Juin 2020, 17:53

Well, sounds like a real prototype conflict/issue, can you open an issue here https://github.com/ndless-nspire/Ndless/issues/new and basically copy-paste your post ? :)
Image

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 80.2%
 
Messages: 14613
Images: 1218
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

Re: TI_NN_NodeEnumInit

Message non lude critor » 13 Juin 2020, 17:45

parisse a écrit:I'm not trying anymore. I found another way to detect that the calculator is connected to a computer (I was not really interested in USB communication, just wanted to know if there was a connection).

How ? ;)
Which port bit are you checking and for which value ?
Image
Avatar de l’utilisateur
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Prochain niv.: 42.1%
 
Messages: 41492
Images: 14556
Inscription: 25 Oct 2008, 00:00
Localisation: Montpellier
Genre: Homme
Calculatrice(s):
MyCalcs profile
YouTube: critor3000
Twitter/X: critor2000
GitHub: critor

Re: TI_NN_NodeEnumInit

Message non lude Adriweb » 13 Juin 2020, 17:50

Some details were given here: https://github.com/ndless-nspire/Ndless/issues/215 but not how it was found :P
Image

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 80.2%
 
Messages: 14613
Images: 1218
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

En ligne

Re: TI_NN_NodeEnumInit

Message non lude parisse » 13 Juin 2020, 20:57

Updated there.
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 77.8%
 
Messages: 3511
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile


Retourner vers Native: Ndless, Linux, ...

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 5 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
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
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1460 utilisateurs:
>1433 invités
>23 membres
>4 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)