Jump to content
The simFlight Network Forums

Grawdyng

Members
  • Posts

    9
  • Joined

  • Last visited

About Grawdyng

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

Grawdyng's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hmm. What if I have the second computer control the calls to FSUIPC_Process and have a second thread running in that program that'll tell it to process everything at regular intervals?
  2. I re-wrote the whole thing, since it was becoming pretty hard for me to follow. This is the new function for handling read/write requests: fsInterface::fsStart() { fsData dat; char * chData; int x = 0; for( ; ; ) { x = recv(*fsSock, (char *) &dat, sizeof(fsData), 0); if(x = 0) { printf("Connection closed\n"); return 0; } if(x = SOCKET_ERROR) { printf("Error %i while receiving data\n", WSAGetLastError()); return 0; } if (dat.header == FS_READ) { chData = new char [dat.dwSize]; if(!FSUIPC_Read(dat.dwOffset, dat.dwSize, chData, &err)) { printf("Error %i while reading from FSUIPC\n", err); return 0; } if(!FSUIPC_Process(&err)) { printf("Error %i while calling FSUIPC_Process\n", err); return 0; } if(send(*fsSock, (char *) &dat, sizeof(fsData), 0)== SOCKET_ERROR) { printf("Error %i while sending data\n", WSAGetLastError()); return 0; } if(send(*fsSock, chData, dat.dwSize, 0) == SOCKET_ERROR) { printf("Error %i while sending data\n", WSAGetLastError()); } } if (dat.header == FS_WRITE) { chData = new char [dat.dwSize]; x = recv(*fsSock, chData, dat.dwSize, 0); if(x = 0) { printf("Connection closed\n"); return 0; } if(x = SOCKET_ERROR) { printf("Error %i while receiving data\n", WSAGetLastError()); return 0; } if(!FSUIPC_Write(dat.dwOffset, dat.dwSize, chData, &err)) { printf("Error %i while writing to FSUIPC\n", err); return 0; } if(!FSUIPC_Process(&err)) { printf("Error %i while calling FSUIPC_Process\n", err); return 0; } } } } At least I know the whole thing will build, and the TCP/IP code I wrote works. Still can't test it without a registration key, I'll try to get around to taking care of that tomorrow.
  3. Ah thanks. I should've caught that myself, but I'm kind of rusty. This is the first major project I've done in a good two years or so.
  4. When I try this. What am I doing wrong?
  5. Oh, it's definitely helpful. The other PC is an AMD XP 2500 running FreeBSD 5.3. So no problems there. The windows "send" function wants an array of chars for its data, could I: struct this_data { DWORD offset; DWORD size; char data [WHATEVER_SIZE_WORKS_BEST] }; and then send it like send(socket, (char) this_data and so on...?
  6. Hello, I've finally started work on the software for my simpit. I'm building the hardware entirely from scratch. No EPIC or the like, I can't afford it. Right now I want to have the FS2004 computer talk to another computer over the network, and share data with it. I can't use WideFS, since this other computer isn't running Windows. I know barely enough about TCP/IP programming to get both computers to happily swap strings of text across the network, now, I need to get them to do something useful with them. This is what I need help on. This network takes a request that has come over the network in the form of an array of chars, turns them into DWORDs so it can feed those values into the FSUIPC_Read() function. I'm not really sure how else to do this, and I can't really test what I have yet since I forgot to actually buy a copy of FSUIPC, which I'll try to get around to tonight. readOffset(char *buffer, DWORD *rerr) { DWORD fsOffset = 0; DWORD fsSize = 0; if(buffer [0] == 0xF0) { fsOffset = buffer [1]; fsOffset << 4; fsOffset | buffer [2]; fsOffset << 4; fsOffset | buffer [3]; fsOffset << 4; fsOffset | buffer [4]; fsSize = buffer [5]; fsSize << 4; fsSize | buffer [6]; fsSize << 4; fsSize | buffer [7]; fsSize << 4; fsSize | buffer [8]; char *x = new char [fsSize]; FSUIPC_Read(fsOffset, fsSize, x, rerr); if(!FSUIPC_Process(rerr)) return 0; buffer = x; } return 1; } Would this even work? Is there a better way to do this? Any help or advice would be deeply appreciated. I'm pretty tired, so forgive me if I didn't explain this very well.
  7. Thanks for the reply. The software would almost certainly be written in C\C++, as that's what I'm most comfortable with right now (I haven't touched VB in years). I've got to start reading up on working with the serial port in Windows before I actually try any of this, though. I'm in the middle of moving right now so it's going to be a while before I can concentrate on writing any code.
  8. I can afford it, I'm just wondering if I have to. Pete said that freeware apps would get free access keys, I'm just wondering if this applies to something written by me for personal use only. I don't have any need or use for joystick calibration, button programming, weather control or other extraneous features, and I don't really want to have to pay for them.
  9. And FSUIPC is probably the easiest way to interface all the gauges, MFDs and everything with the computer, but I'm wondering if I need to buy a registered copy. I don't have any use for the weather controls or other features, I just need to be able to export data from the simulator, and I really don't want to have to pay for it. I have hardly any money as it is, and it seems like cockpit building is a very expensive hobby, so I have to keep things as cheap as possible, and probably do almost everything myself. This means no EPIC, prebuilt instruments, lots of expensive real parts, and so on, but I'm fairly confident I can live without those.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.