Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - neil

Pages: 1 ... 5 6 [7] 8 9 ... 30
91
utFAT / GET_SDCARD_WP_STATE() no prototype
« on: November 14, 2014, 05:55:01 PM »
Hi Mark,
  I have loaded the latest uFAT, and during compiling I get no prototype for  GET_SDCARD_WP_STATE(), what should this be?  I am not using write protect, so do I just do a #define GET_SDCARD_WP_STATE() 0?

Regards
Neil

92
utFAT / Re: returning UTFAT_DISK_READ_ERROR during a write.
« on: July 22, 2014, 02:06:31 PM »
Hi Mark,
  As this happens only occasionally , is it possible that some cards (we buy them off the internet in batches) have a slower read/write times than others? Or do you find all about the same?

Regards
Neil

93
utFAT / Re: returning UTFAT_DISK_READ_ERROR during a write.
« on: July 19, 2014, 08:34:27 PM »
Hi Mark,
  Thanks for the reply.  I downloaded your latest version of ufat, but got some errors building my project. I haven't had time to see what they were, so I reverted back to the version before it.  Anyway, I noticed in your latest version that CommandTimeout = 20000. As the last version it was set to 5000, do you think me setting mines to 20000 is a too large value?

Best Regards
Neil

94
utFAT / Re: returning UTFAT_DISK_READ_ERROR during a write.
« on: July 18, 2014, 04:22:31 PM »
Hi Mark,
  Thanks for the quick reply.

I dont have  MAX_POLL_COUNT   in fnSendSD_command(), and I was sure I had the latest SD card files. The updated entry at the top of mass_storage.c file is: 


    11.09.2013 Reduce sector reads when seeking and correct partial sector read when data is in local {59} utFAT1.13


Regards
Neil

95
utFAT / returning UTFAT_DISK_READ_ERROR during a write.
« on: July 18, 2014, 02:04:32 PM »
Hi Mark,
  I have a few hundred units out in the field and working well, but occasionally I get a UTFAT_DISK_READ_ERROR (-4) error returned from a utWriteFile(..) command.  It doesn't always happen to the same units , but they all have the same firmware. I have one file for collecting data ,with 2 file handles (FileStruct) opened on it, one for writing and the other for reading .  I have set the read to UTFAT_MANAGED_MODE so its always updated on every write. I have looked through my code but cant see any problems, it can run for days, collecting data every minute before it happens.

Regards
Neil

96
µTasker general / Enabling/Disabling Serial port
« on: June 17, 2014, 03:16:30 PM »
Hi Mark,
   Throughout my application I wish to simply switch off/on the RX side of a serial port, but also keep all settings as before (baud rate,handshaking etc..).  Can I simply use the lines:
   fnDriver( SerialPortID,RX_ON, 0 );   
            and
   fnDriver( SerialPortID,RX_OFF, 0 );   

  Regards
   Neil

97
utFAT / UTFAT_MANAGED_MODE
« on: June 12, 2014, 11:54:11 AM »
Hi Mark,
   I have 4 file handles opening the same file, 2 write and 2 read. Do I set the UTFAT_MANAGED_MODE on ALL file handles or just the read?

At present I set only the files open for read to UTFAT_OPEN_FOR_READ | UTFAT_MANAGED_MODE , but want to make sure all file handles will be updated.

Best Regards
Neil

98
µTasker general / Re: cleaning up a socket with no connection
« on: April 21, 2014, 05:29:16 PM »
Hi Mark
  When i only reuse sockets that the state is marked TCP_STATE_CLOSED, all works well. A set of sockets are used every ten seconds, and if the socket cant be reused straight away i simply get the next free one, and within the next ten seconds any ones that werent available are now marked TCP_STATE_CLOSED and are available. Do you see any problems using this method, i cant see me needing any more sockets that are available in the pool.

regards
neil


99
µTasker general / Re: cleaning up a socket with no connection
« on: April 21, 2014, 10:55:54 AM »
Hi Mark,
   I am still having the same issues (after copying over tcp.c). I placed some messages on the screen and debugged the code and this is what is happening.

The first time around TCP_STATE_CLOSED is called and I mark the socket as to be used again (within my own code).  When I try to re-use the socket the TCP_STATE_CLOSED is called again , as within the fnTCP_Connect() function :

    if (!(ptr_TCP->ucTCP_state & (TCP_STATE_RESERVED | TCP_STATE_LISTEN | TCP_STATE_CLOSED))) { // are we in an invalid state?
#ifdef REUSE_TIME_WAIT_SOCKETS
          if (ptr_TCP->ucTCP_state & (TCP_STATE_FIN_WAIT_2 | TCP_STATE_TIME_WAIT)) {
            fnNewTCPState(ptr_TCP, TCP_STATE_CLOSED);
         ptr_TCP->event_listener(ptr_TCP->MySocketNumber, TCP_EVENT_CLOSED, ptr_TCP->ucRemoteIP, ptr_TCP->usRemport); <<<  gets called again.
        }
        else {
            return (SOCKET_STATE_INVALID);
        }

As I mark each socket to be reused within the TCP_STATE_CLOSED, getting called again, simply marks as re-use. I checked the value of ptr_TCP when TCP_STATE_CLOSED was called and when the above was called to make sure the pointer address was the same, and they were.

I assume this is the reason why my code always works when calling fnGetTCP_state(..) before reusing the socket.

 Looking at usOurPort parameter within fnTCP_Connect(..) function, should this be set to 1 if reusing a socket ? I noticed withing the fnTCP_Connect(..) function ,fnGetFreeTCP_Port() gets called if usOurPort=0. I tried setting to 1 , but still no luck.



Regards
Neil



100
µTasker general / Re: cleaning up a socket with no connection
« on: April 20, 2014, 08:34:49 PM »
Hi Mark

Thanks for that, I look forward on getting the password.

I looked at the latest patch SP9 and it says its 1.30 on the zip file header, is this actually 1.40?

regards
Neil

101
µTasker general / Re: cleaning up a socket with no connection
« on: April 20, 2014, 06:52:41 PM »
Hi Mark,
  I noticed the tcp.ip you attached earlier had changes in 2014, does the latest patch have these updates?  I tried downloading the patch, but cant find my password, can you check if it is still valid, if so please email it to my address?

Many Thanks

Best Regards
Neil

102
µTasker general / Re: cleaning up a socket with no connection
« on: April 20, 2014, 09:30:02 AM »
Hi Mark,
  I have an old tcp.c, the last update I have is 29/12/2009 {16}, which doesn't include re-using TCP_STATE_TIME_WAIT. I tried compiling your file , but got lots of errors (which I suspect because of old headers too).   Would it be possible to get a copy of the headers ?

Many Thanks

Regards
Neil

103
µTasker general / Re: cleaning up a socket with no connection
« on: April 19, 2014, 04:04:58 PM »
Hi Mark
  if i treat the _WAIT_STATE as _CLOSED my application doesnt make a connection, and wait state is returned. I make a few samples every ten seconds, and if i check the status first, and only use when marked closed, i never get an error, the socket is cleared by the next ten seconds. My windows application it connects to is on the same LAN.

regards
neil

104
µTasker general / Re: cleaning up a socket with no connection
« on: April 19, 2014, 12:06:44 PM »
Hi Mark,
 
After I get a  TCP_STATE_CLOSED , I reuse the socket again. I also use the fnGetTCP_state() and I sometimes get a TCP_STATE_TIME_WAIT. So even though the socket is closed its not always available? And it looks like I should always use the  fnGetTCP_state() when getting a socket from the pool?

Best Regards
Neil

105
µTasker general / Re: cleaning up a socket with no connection
« on: April 18, 2014, 07:47:54 AM »
Hi Mark,
  Thanks for the reply.

When the connection cant be established, and I call fnTCP_close() , it takes a while for the TCP_EVENT_CLOSED in callback to be called, is this normal?.

If I don't use fnReleaseTCP_Socket(), will the socket be safe to reuse when the TCP_EVENT_CLOSED is called? If not when is it safe to reuse it?

Best Regards
Neil

Pages: 1 ... 5 6 [7] 8 9 ... 30