embeddedmasters can help you with the cut and paste problem into Eclipse.
The online documentation is all we provide. Note that many lower level APIs are intentionally hidden and not intended to be publicly exposed for reasons outside the scope of this discussion.
// The following will set the watermark value to 1 byte and trigger an interrupt on every byte received.
There are a few threads on this subject you should take a look at, both contain sample code:
There are many more PUART related threads here as well: WICED Smart Forums
Thanks for the quick reply!
I'm not having any cut and paste problems with Eclipse. I've used Eclipse for years, and aside from still being absurdly slow, it mostly works OK. My comment was about trouble pasting code into this forum. There may well be some easy way to do it, but it's not readily apparent.
Apparently the comments in the PUART code I copied were wrong, because it was already setting the value to 1, even though the comment said that it would interrupt after 15 bytes received. I'll have to experiment with it further to figure out what's going wrong.
I've worked for a semiconductor company that made SoCs, so I well understand many of the reasons why you abstract away nearly all of the low-level stuff and details of the protocol stack. However, I think in some areas, such as the PUART, this has gone too far by not documenting something that customers are actually supposed to use.
Thanks especially for the link to the "UART Routines" thread. My next question was going to be how to use the transmit callback, another essentially undocumented part of the PUART API, and it's actually covered pretty well in that thread.
I see. You are correct, cutting and pasting directly from Eclipse into the forums is tricky as the system adds alot of formatting that is uneeded.
What I normally do is cut and paste from Eclipse, into a text editor like Windows Notepad, then cut and paste from it into the form.
Below is an example I just pulled from the pwm_tones app. Extra step, but works great.
const UINT8 tones_gatt_database=
// Handle 0x01: GATT service
// Service change characteristic is optional and is not present
PRIMARY_SERVICE_UUID16 (0x0001, UUID_SERVICE_GATT),
// Handle 0x14: GAP service
// Device Name and Appearance are mandatory characteristics. Peripheral
// Privacy Flag only required if privacy feature is supported. Reconnection
// Address is optional and only when privacy feature is supported.
// Peripheral Preferred Connection Parameters characteristic is optional
// and not present.
PRIMARY_SERVICE_UUID16 (0x0014, UUID_SERVICE_GAP),
// Handle 0x15: characteristic Device Name, handle 0x16 characteristic value.
// Any 16 byte string can be used to identify the sensor. Just need to
// replace the "Tones" string below.
CHARACTERISTIC_UUID16 (0x0015, 0x0016, UUID_CHARACTERISTIC_DEVICE_NAME,
LEGATTDB_CHAR_PROP_READ, LEGATTDB_PERM_READABLE, 16),
Note that the UART Routines thread is the definitive source for all PUART threads.