Heyo,
Eric, I think you started to mention something about this last night.
But do we
want a separate method for setting each field in the USB packet? There
are
several fields that we won’t ever need to set on our end, only need to
read.
For instance, the dropped packets field.
So heres what i’m thinking:
// Create the payload
// ‘packet_ptr’ is a pointer to a USB packet in memory
// ‘samples’ is a vector of unsigned char
//
// the payload can be inferred from the samples and inserted in to the
packet
//
// the method should also pad the payload
usb_set_payload(packet_ptr, samples)
// Set the timestamp
//
// ‘packet_ptr’ is a pointer to a USB packet in memory
// ‘timestamp’ is a 32 bit int
usb_set_timestamp(packet_ptr, timestamp)
// Set the channel
//
// ‘packet_ptr’ is a pointer to a USB packet in memory
// ‘channel’ is an integer
//
// Should this also error check on the channel number? (5-bit limit)
usb_set_channel(packet_ptr, channel)
// Set the start of burst flag
//
// ‘packet_ptr’ is a pointer to a USB packet in memory
//
// This just needs to flip a bit
usb_set_start_of_burst(packet_ptr)
// Set the end of burst flag
//
// ‘packet_ptr’ is a pointer to a USB packet in memory
//
// This just needs to flip a bit
usb_set_end_of_burst(packet_ptr)
Discussion:
Do we need methods to unset burst flags? I don’t see a need for them.
Should we have a method to zero out the packet? Or are we just going to
just
use low level memory clearing methods?
- George