- Code: Select all
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: Select all
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: Select all
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.
...