JULIANCROSSTITAN
Forum Noob
Is it possible in any way to use PS3 net servers via an Android device?
AFAIK There is not known port of ps3netsrv for Android or iOS.Is it possible in any way to use PS3 net servers via an Android device?
I checked the source at:
https://github.com/aldostools/webMAN-MOD/blob/master/include/netserver.h
Does the method "netsvrd_thread" stays in a "ethernal" loop, listening for clients?
I think there's room to create an Arduino build using this, but I'm not sure if it has enough resources... Anyway, I'll concentrate on Android first.haven't reviewed the code, but yes I assume that the logic approach would be to keep a thread running in a loop, waiting for connections.
Then when a connection arrives, the server usually creates a new thread or fork process to handle that connection.
I checked the source at:
https://github.com/aldostools/webMAN-MOD/blob/master/include/netserver.h
Does the method "netsvrd_thread" stays in a "ethernal" loop, listening for clients?
Ok, I already have the "basic UI" done and working as I expected. Time to move to the next challenge: write the Cobra NetIso protocol in JAVA (or, try to import the C/C++ code to the project)... It's also saving settings (folder path and, port).
Great. Just a little question: I saw hzy3774 has included the un7zip library in the android project and, the interface he/she used has some "includes" (7zExtractor.h) that handles the methods (extractFile, extractAsset, ...) called by the API:Just in case, if you are looking for an example on how to compile c/c++ code and include it in your Java/Android stuff, you can check this repo: https://github.com/hzy3774/AndroidUn7zip
the dev built a java wrapper around the 7zip unpacker code (c++)
Great. Just a little question: I saw hzy3774 has included the un7zip library in the android project and, the interface he/she used has some "includes" (7zExtractor.h) that handles the methods (extractFile, extractAsset, ...) called by the API:
https://github.com/hzy3774/AndroidU...648ffb/un7zip/src/main/cpp/un7zip/un7zApi.cpp
As I don't have a library to include, because ps3netsrv is a program, should I create a main.h to define the main method? (sorry about this noob question, but I never used C/C++ for nothing since the first year of the college...)
I got it, the thread is already running and recieving socketsoh I totally missed this message, sorry man!
so, my concern is that ps3netsrv is a server, so the "main" will also have some threads and will have the socket process, and I'm not sure how that would work with the Java wrapper.
I'd suggest to have the networking and threading code ported to Java, and if there's any basic function like reading ISO files and folders, that stuff you could keep it in C and use it through the wrapper.
So yes in the end the app would be an hybrid, and perhaps it will be easier for you to port everything and be done with it.
my idea:
- identify the basic I/O file handling functions that can remain in C, and write a wrapper for those
- port all the socket/networking stuff, and the threading so it's native in Java
in any case, don't take this as a proved solution, as I haven't done anything using Java/Android in ages
Ok, I got a byte array from the PS3 request, but I don't know the size of the opcode to get it right (I thinks it's a 4 bytes info).... Because I got a byte array starting with 0x122A (NETISO_CMD_OPEN_DIR). Is the opcode always at the start and with 4 bytes?I got it, the thread is already running and recieving sockets(in Java of course...).
Ok, I got a byte array from the PS3 request, but I don't know the size of the opcode to get it right (I thinks it's a 4 bytes info).... Because I got a byte array starting with 0x122A (NETISO_CMD_OPEN_DIR). Is the opcode always at the start and with 4 bytes?
Thanks. Yeah, I did a mistake with bits and bytes, sorry. So the commands always have 16 bytes? An opCode and 14 bytes of data?Yes the opcode is always the first field, but it is 16bit (2 bytes) not 4 bytes.
Each opcode has it's own data structure.
https://github.com/aldostools/webMAN-MOD/blob/master/cobra/netiso.h
understood.Yes the opcode is always the first field, but it is 16bit (2 bytes) not 4 bytes.
Each opcode has it's own data structure.
https://github.com/aldostools/webMAN-MOD/blob/master/cobra/netiso.h
Thanks. Yeah, I did a mistake with bits and bytes, sorry. So the commands always have 16 bytes? An opCode and 14 bytes of data?
typedef struct _netiso_cmd
{
uint16_t opcode;
uint8_t data[14];
} __attribute__((packed)) netiso_cmd;
so, the PS3:The opcode is 16bit (2 bytes).
The netiso command (request received) is always 16 bytes.
Code:typedef struct _netiso_cmd { uint16_t opcode; uint8_t data[14]; } __attribute__((packed)) netiso_cmd;
The fields (struct) in the 14 bytes of data depends of the opcode. Each opcode has a corresponding struct.
The struct of the result also depends of the opcode.
Each netiso command received executes a subroutine where the request is processed and returns a result.
I think I got it. It's dpLen atribute (the size of the string that cames at the end).so, the PS3:
sends opCode + commands (2 + 14 = first 16 bytes)
Everything that came after this is related to some information useful inside the subroutine defined by the first 16 bytes?
I'm getting NETISO_CMD_OPEN_DIR (opCode) and "0x0001000000000000000000000000" and at the 17 byte, I have a "/" slash. I understood that the PS3 is requesting to open "/", but what is the "0x0001...." on the "14 byte" array? I tried to understand the C/C++/go code, but this goes a little bit away from what I know![]()