Commit Graph

152 Commits

Author SHA1 Message Date
Dean Camera 34e0fed4ca Make the RFCOMM_SendFrame() function correctly generate frames from the input parameters, change addressing to use the raw DLCI address plus flags. 2010-06-07 09:07:18 +00:00
Dean Camera 361e1ec1d8 Refactor out RFCOMM packet send code into a seperate function. 2010-06-06 14:39:51 +00:00
Dean Camera 2dabb4e55f Add the svn:eol-style property onto new files which where missing it to ensure uniform line endings. 2010-06-06 08:33:14 +00:00
Dean Camera efbedcfa54 Document Bluetooth files with overall file Doxygen comments. Add more initial RFCOMM layer code to receive and respond to SABM packets. 2010-06-04 06:25:12 +00:00
Dean Camera 6d53cdba83 More documentation fixes. 2010-06-03 15:55:28 +00:00
Dean Camera fc92f9969c Minor documentation cleanups. 2010-06-03 15:32:45 +00:00
Dean Camera 9293de2491 Start implementation of RFCOMM decoding layer. Add new service initialize routines for each Bluetooth service - currently unused, but will eventually reset the service state of RFCOMM when a new connection is made. 2010-06-03 12:45:15 +00:00
Dean Camera 13d812a718 Delay needed in bluetooth code due to the send function not waiting for the pipe bank to become ready before writing. Add in a call to Pipe_WaitUntilReady() to fix the issue. 2010-06-03 08:42:20 +00:00
Dean Camera a405a9bdf8 Extra protocol value in the RFCOMM protocol is the channel number, not the PSM - update typedef name and size.
Add delay to the Connection Request signal processing routine - without this, the host will not create the RFCOMM channel correctly. Need to investigate why this delay is needed.
2010-06-03 08:33:01 +00:00
Dean Camera 480da5aab6 Add PSM value to the RFCOMM service so that the host knows what PSM to use on channels when trying to access it. 2010-06-03 07:45:09 +00:00
Dean Camera 008e0e2e0a Add start of RFCOMM service layer to the incomplete BluetoothHost demo.
Reduce the size of the attribute search list from 15 ranges to 8 to save RAM.
2010-06-03 03:58:57 +00:00
Dean Camera 23a94a7181 Fix byte ordering of UUIDs in the SDP server - host can now successfully pair to the Bluetooth device and discover the exposed Serial Port Profile RFCOMM service. 2010-06-02 14:49:06 +00:00
Dean Camera c362709a1e The SDP UUID lists should be searched and ALL UUIDs matched for a record to be retrieved, not partial matches. Change the SDP code so that the entire list must be matched against a service attribute table's contents before it is returned.
Change matching algorithm so that it recursively searches through the entire attribute table, and not just pre-specified sequence attributes.

Add browse lists and proper descriptions to the Serial Port service.
2010-06-02 07:05:34 +00:00
Dean Camera da51c1f974 Add L2CAP service attribute table. Fix up ProtocolDescriptorList attributes, and add macros for used UUIDs to reduce typing and make the code easier to read. 2010-06-02 04:36:46 +00:00
Dean Camera b98158bd50 Clean up the Service tables, add incomplete ProtocolDescriptorList attribute to the SDP service. 2010-06-01 14:05:47 +00:00
Dean Camera 32ab52a298 Remove incorrect Language ID offset attribute from the SDP server - client assumes 0x0100 offset for primary language anyway, and the format of the offset was incorrect anyway. 2010-06-01 13:11:55 +00:00
Dean Camera 255d4ef858 Service Attribute SDP requests should have only one Data Element Sequence container around the single service's retrieved attributes, not two. 2010-06-01 12:34:48 +00:00
Dean Camera 0902ff9651 Document inline SDP data read/write functions. 2010-06-01 11:38:07 +00:00
Dean Camera 3f3fdb01a9 Much faster attribute range lookup - look through short list of attributes and compare to range, rather than looking up by each possible value within the range.
Cleanups to SDP code. Add missing RFCOMM language base ID offset attribute. Fix incorrect definition of the SWAPENDIAN_32() macro.
2010-06-01 11:07:29 +00:00
Dean Camera cb52e4371e Fix the encoding of UUIDs in the SDP server so that they match the Bluetooth UUID format properly. 2010-06-01 04:22:20 +00:00
Dean Camera e0ef5741d4 Move SDP service tables out into a new set of files, to make the SDP service code cleaner. 2010-06-01 03:07:05 +00:00
Dean Camera 587f320333 Add Service Attribute request processing to the SDP server code. 2010-06-01 02:54:53 +00:00
Dean Camera e15838d4e2 Fix endianness issues in the Service Discovery Protocol service of the incomplete Bluetooth Host demo. Host can now correctly retrieve specific services, however Windows does not appear to be sending the appropriate generic browse class IDs needed to report the virtual serial service. 2010-05-31 14:08:15 +00:00
Dean Camera c1daecf18b Fixed incorrect signature for the ATMEGA32U2 in the DFU bootloader (thanks to Axel Rohde).
Partial fix to the Bluetooth SDP code - data should be encoded in big endian, not little endian.
2010-05-29 07:51:01 +00:00
Dean Camera 4a13a5484a Fixed RNDISEthernet demos crashing when calculating checksums for Ethernet/TCP packets of more than ~500 bytes due to an overflow in the checksum calculation loop (thanks to Kevin Malec).
Removed string Attributes from the Service Discovery Protocol code to minimise the potential points of failure while the base code is being debugged.
2010-05-25 06:14:37 +00:00
Dean Camera 8f3d4e69c3 Add UUID Class matching to the Service Discovery Protocol code - SDP is now correctly matched against the generic Service Discovery Class UUID. 2010-05-23 13:15:19 +00:00
Dean Camera 776485a6c5 Remove obsolete entry from the Doxygen configuration files. 2010-05-23 08:39:02 +00:00
Dean Camera 8cdb141eed SDP Service improvements; fixed UUID for SDP service, added Service Discovery Server UUID, better documentation. 2010-05-23 08:36:51 +00:00
Dean Camera a20a9086f7 Add comments and partial Doxygen documentation to the incomplete Bluetooth SDP handler code. 2010-05-21 09:38:44 +00:00
Dean Camera 58a0ee67a3 Oops - when adding a sequence header to the SDP response, the size value needs to be cleared, not the buffer pointer. 2010-05-21 08:01:41 +00:00
Dean Camera 92bebc457f Add incomplete code to properly handle attribute responses to Service Discovery Protocol requests. 2010-05-21 07:10:49 +00:00
Dean Camera 83b5c916c6 Service Discovery ServiceSearchAttribute requests require the response to be grouped by UUID, so the response can't be generated as the attributes are read in. Buffer both UUIDs and Attributes instead and generate the response afterwards. 2010-05-20 14:35:52 +00:00
Dean Camera 3e515cdfa8 Short UUIDs are measured in bytes, not bits -- update Service Discovery Protocol code so that it can now correctly match against UUIDs in the service table. 2010-05-20 13:06:04 +00:00
Dean Camera 141d94fa98 More SDP code improvements - responses to ServiceSearchAttribute service discovery requests should now be valid, even if they do not currently return the device's services and service attributes.
Added more documentation to the incomplete Bluetooth stack code.
2010-05-20 08:27:04 +00:00
Dean Camera 78600e2485 Switch over the BluetoothHost demo's Service Discovery code to pass around more generic GUID arrays. 2010-05-18 12:54:01 +00:00
Dean Camera f13bc35a19 Begin processing code for Service Discovery Protocol attributes. 2010-05-17 23:36:05 +00:00
Dean Camera ee5ea4ce2b Fix nasty bug in USBInterrupt.c which would cause a lockup if the control endpoint was not selected at the point the USB endpoint interrupt fires when INTERRUPT_CONTROL_ENDPOINT is defined. 2010-05-11 13:45:23 +00:00
Dean Camera 53ebb2f21a Refactor Service Discovery Protocol code in the incomplete Bluetooth Host demo, so that the UUID list is compiled via a seperate function to allow for its re-use between different SDP request types. 2010-05-10 13:56:16 +00:00
Dean Camera 071e02c6b6 Add svn:eol-style property to source files, so that the line endings are correctly converted to the target system's native end of line style. 2010-05-08 03:12:14 +00:00
Dean Camera e331b531c6 Change over instances of "make" in the makefiles to "$(MAKE)" to allow for the make tool to be overridden. 2010-05-07 07:11:25 +00:00
Dean Camera 27eb17cb93 Change over unix line-endings to dos line endings. 2010-05-07 06:40:47 +00:00
Dean Camera 9cad677ebb The Audio_Device_IsSampleReceived() and Audio_Device_IsReadyForNextSample() functions are now inline, to reduce overhead. 2010-04-29 14:54:11 +00:00
Dean Camera e977774d4e Relocate USBInterrupt.c/.h from the HighLevel USB driver directory to the LowLevel directory as it is hardware-dependent. 2010-04-28 08:15:16 +00:00
Dean Camera 59c4871f80 USB_Init() no longer calls sei() to enable global interrupts - this must now be done in the user application once all init code has run. 2010-04-28 07:48:26 +00:00
Dean Camera 5993e1efe7 Added ability to search by Channel PSM to the GetChannelData() function in the BluetoothHost demo.
Added new HCI states to properly initialize the bluetooth dongle and retrieve the local BDADDR.

Factored out Bluetooth state information into a new state structure for easy reference in the user application.

Added new StackInitialized() Bluetooth stack callback function.
2010-04-22 14:08:00 +00:00
Dean Camera 8252b4febd Fixed HID Device Class Driver not allocating a temporary buffer when the host requests a report via the control endpoint and the user has set the PrevReportINBuffer driver configuration element to NULL (thanks to Lars Noschinski).
Clean up incomplete BluetoothHost debugging commands to use GCC extension to avoid NULL parameters when no formatting is required.
2010-04-20 08:52:51 +00:00
Dean Camera d03d6513d0 Add start of a SDP service table, which will be linked to the Bluetooth SDP code. 2010-04-19 12:39:58 +00:00
Dean Camera d92e9133d3 Make bluetooth SDP code correctly unpack the search UUIDs and parameters.
Minor documentation improvements.
2010-04-19 10:53:14 +00:00
Dean Camera fc8e4837a9 Add const keyword to the demo function parameters where possible. 2010-04-18 12:10:30 +00:00
Dean Camera 55db57e1ed Add bluetooth channel connection callback to the incomplete BluetoothHost demo. 2010-04-18 04:47:52 +00:00
Dean Camera 1f682ca2de Minor documentation improvements. 2010-04-15 14:22:06 +00:00
Dean Camera 3eb81df998 Rename FunctionAttributes.h to Attributes.h, as some attributes are applicable to variables also. Add new ATTR_NOINIT attribute for global variables.
Add the beginnings of a SDP implentation to the incomplete BluetoothHost demo.

Add const attribute to the Mass Storage Host driver functions where it was applicable, but missing.
2010-04-15 11:04:24 +00:00
Dean Camera e55f338663 Document the Bluetooth ACL layer. Remove unneeded parameters from the signalling command processing routines.
Change over the code so that the bluetooth packet data is read in by the stack rather than the user application, to make it more unform for sending/receiving, and so the library can handle incomming fragmentation in the future.

Start Service Discovery Protocol decoding and processing.
2010-04-13 11:19:04 +00:00
Dean Camera 882ef0c983 Add some more documentation to the half-completed Bluetooth Host demo, fix the OpenChannel() command initialising the channel information structure to the wrong initial state once the CONNECTION REQUEST command has been sent to the remote device. 2010-04-12 14:26:56 +00:00
Dean Camera 8b0ec6c5ca Fix Bluetooth stack CONNECTION RESPONSE packets - for this command and this command only, the source/destination roles are switched. Reverse the Local/Remote channel ordering so that Windows mobile and other stacks which depend on valid channel values to connect. 2010-04-12 13:42:35 +00:00
Dean Camera 6cfa3b7db8 Add HCI debugging with verbosity control to the BluetoothHost demo.
Add Link Key Request event processing so that paired devices always re-authenticate until appropriate link key store/retrieve callbacks are implemented.
2010-04-11 06:19:58 +00:00
Dean Camera 26421b38cd Fix up Bluetooth Demo's options processing on incoming channel configuration requests. 2010-04-11 02:45:42 +00:00
Dean Camera 28f1ac8117 Add LUFA-side channel open/close routines, add signalling handlers for the creation and configuration of channels from the local device to the remote device, to add to the existing remote to local channel capabilities. 2010-04-10 07:33:19 +00:00
Dean Camera 797130bddc Bluetooth demo can now create and maintain logical channels - need to determine why Windows machines refuse to connect. 2010-04-10 05:58:37 +00:00
Dean Camera 2a072db703 Make Bluetooth signalling handler routines use the generic Bluetooth_SendPacket() routine for their responses. Use a better method of controlling the debug output verbosity. 2010-04-06 13:39:18 +00:00
Dean Camera c77f136661 Add bidirectional channel configuration -- remote device is not ACKing sent Configuration Requests, needs further debugging. Implement Bluetooth spec's channel states.
Use abbreviations for the structure and function names where possible to try to cut down on the code verbosity.
2010-04-06 08:14:08 +00:00
Dean Camera b9c7d19615 Add packet reception and send routines to the ACL layer of the incomplete Bluetooth Host demo. 2010-04-06 03:56:45 +00:00
Dean Camera ee74b4948f Add information request/response signal handler to the Bluetooth Host demo.
Ensure that the AVRISP-MKII project's Windows avrdude compatibility define is named properly in all parts of the code.
2010-04-06 02:48:47 +00:00
Dean Camera 083d797aca Add Bluetooth signalling echo request/response handlers, disconnection request/response handlers.
Add Bluetooth connection request/complete/disconnection callbacks.

Remove debugging from HCI layer, as it is now operational -- add guards to ACL debug statements to reduce logging chattyness so that the overall command sequences can be observed and debugged.
2010-04-05 12:13:33 +00:00
Dean Camera fa1a092901 Add user callback function to the Bluetooth host demo to filter out connections from remote devices. Add in ability to reject connections based on their bluetooth device address.
Clean up RelayBoard project code.

Make AVRISP project clear the XMEGA target's reset register twice; this does not appear to take affect properly the first time under some circumstances.
2010-04-05 08:09:12 +00:00
Dean Camera fd96b28882 More improvements to the incomplete BluetoothHost demo - add Disconnection Event processing.
Remove unused macro in the host mode demos for the maximum Configuration Descriptor size.
2010-04-01 04:30:21 +00:00
Dean Camera a2e6d54336 Massive cleanups to the incomplete BluetoothHost demo, to make the HCL layer code much easier to read, block less and work correctly. 2010-03-31 14:32:03 +00:00
Dean Camera c58c53dba9 Added incomplete MIDIToneGenerator project. 2010-03-23 09:16:47 +00:00
Dean Camera 15f84bb8f5 New BOARD value option BOARD_NONE (equivelent to not specifying BOARD) which will remove all board hardware drivers which do not adversely affect the code operation (currently only the LEDs driver).
Spell-check code/comments in the Webserver/AVRISP-MKII projects.
2010-02-04 02:27:09 +00:00
Dean Camera 7f9f97c792 Update copyright year to 2010. 2009-12-30 23:49:19 +00:00
Dean Camera 0ea819f781 Fix TemperatureDataLogger - sample tick timer wasn't being initialized in the correct CTC mode. 2009-12-30 13:35:24 +00:00
Dean Camera d4ca7fb44c Fix MIT license language to make its intent clearer. 2009-12-28 00:34:20 +00:00
Dean Camera 3705330dd3 Use -pedantic compile time option to find and correct several minor code errors. 2009-12-13 14:09:25 +00:00
Dean Camera 7ace314cc1 Increase timeout of Mass Storage and Still Image host commands to 10 seconds (up from 5) to account for slow-processing devices.
Added brace guards to macros with parameters to prevent unintended changed evaluation of the macro expression.

Minor code cleanups (remove redundant comments, fix spacing, etc.).
2009-12-09 00:50:55 +00:00
Dean Camera e625fd6df3 Corrected the name of the misnamed USB_GetDeviceConfigDescriptor() function to USB_Host_GetDeviceConfigDescriptor(). 2009-11-13 10:07:25 +00:00
Dean Camera d6edfe35c8 Spell check all source code variables, comments and strings. 2009-11-09 13:15:28 +00:00
Dean Camera 34dc7f241f Make Low Level host demos use void pointers for the configuration descriptor, to prevent warnings when passed to the altered configuration descriptor parsing routines.
Added preprocessor checks to give a human readable error when the class drivers are used when the incompatible NO_STREAM_CALLBACKS compile time option is used.
2009-11-07 07:23:03 +00:00
Dean Camera c3dfc58707 Fix invalid Event name rule in demo/project makefiles. 2009-10-16 08:04:51 +00:00
Dean Camera fa8d25ef29 Remove old OTG demo directory with useless TestApp demo. Add new DualRole directory with new Class Driver powered Mouse dual role demonstration application showing a dual role device using the HID host/device Class drivers. 2009-09-29 07:13:42 +00:00
Dean Camera b221e7d175 Remove USE_NONSTANDARD_DESCRIPTOR_NAMES compile time token, split out standard descriptors into seperate USB_Descriptor_* and USB_StdDescriptor_* structures so that both can be used within the one project.
Add guard to the HID Host Class driver SetProtocol command, to ensure that the device supports boot protocol mode before issuing the request.
2009-09-09 13:17:04 +00:00
Dean Camera 0486f12e3e Add in new invalid event hook check targets to project makefiles to produce compilation errors when invalid event names are used in a project.
Re-add in flip, flip-ee, dfu and dfu-ee targets to project makefiles (thanks to Opendous Inc.)

Fix allowable F_CPU values comment in project makefiles.
2009-09-06 05:58:40 +00:00
Dean Camera f9f1bcc25c Oops - with new changes to the way the device Configuration Descriptor is retrieved from the device, ensure that the correct position pointer is cast when extracting descriptor parameters. 2009-08-31 08:27:48 +00:00
Dean Camera 7fbb759287 Changed the parameters and behaviour of the USB_GetDeviceConfigDescriptor() function so that it now performs size checks and data validations internally, to simplify user code. 2009-08-31 07:48:32 +00:00
Dean Camera 0f51db56c0 Replace -finline-limit with -fno-inline-small-functions in project makefiles. 2009-08-30 06:52:03 +00:00
Dean Camera c830fcb0e1 Make Endpoint control transfers more reliable; early-abort when an incomplete packet is sent from the host (indicating end of transfer), add check for control reads to ensure that no more than wLength bytes are read from the interface.
Condense sequential printf_P/puts_P calls to single printf_P calls for size and clarity.
2009-08-06 14:22:04 +00:00
Dean Camera c5038f1bf4 Renamed all library events to properly seperate out Device and Host mode events. Changed the firing conditions for some events to ensure that events are fired by their own USB mode only.
Remove VBUS events - not needed as the library takes care of VBUS detection and feedback on supported AVRs via the USB_Device_Connected and USB_Device_Disconnected events.

Fixed incorrect Host state assignment in the incomplete BluetoothHost demo.
2009-08-05 06:36:31 +00:00
Dean Camera 3472af91a5 Change project makefiles so that the current target settings and not just the board selection is printed during the build process.
Fix warning in AudioOutput demos when AUDIO_OUT_STEREO output mode is selected.
2009-07-28 13:53:52 +00:00
Dean Camera e071f3897a Added new USB_DeviceState variable to keep track of the current Device mode USB state.
Added new Endpoint_ClearStatusStage() convenience function to assist with the status stages of control transfers.

Removed vague USB_IsConnected global - test USB_DeviceState or USB_HostState explicitly to gain previous functionality.

Removed USB_IsSuspended global - test USB_DeviceState against DEVICE_STATE_Suspended instead.

Fixed possible enumeration errors from spinloops which may fail to exit if the USB connection is severed before the exit condition becomes true.
2009-07-21 13:31:21 +00:00
Dean Camera cf313989e6 Don't send terminal RESET codes via serial - just set the foreground colour and assume the user has the background set to something sane, so that the demos don't wipe out custom user terminal settings. 2009-07-19 13:17:38 +00:00
Dean Camera cc879df4f0 Use sane ANSI terminal escape codes for the Host mode demos, so that they do not cause eye-searing, unreadable text on terminals which parse the escape codes properly. 2009-07-19 13:08:48 +00:00
Dean Camera 0fcbe22c9e Added new HOST_STATE_WaitForDeviceRemoval host state machine state for non-blocking disabling of device communications until the device has been removed (for use when an error occurs or communications with the device have completed). Changed over all host mode demos to use the new state.
Added verbose documentation for each of the USB Host state machine states.
2009-07-13 05:34:43 +00:00
Dean Camera 23f3c3deee Fixed compilation error in incomplete BluetoothHost demo. 2009-07-11 15:07:07 +00:00
Dean Camera e0af6014a7 Added incomplete PrinterHost demo application.
Seperated out Lib components of the incomplete BluetoothHost demo application out into a seperate Lib subfolder.

Changed F_CLOCK entries in project makefiles to alias to F_CPU by default, as this is the most common case.
2009-07-11 15:05:56 +00:00
Dean Camera a3a04aa671 Pipe_ConfigurePipe() now automatically defaults IN pipes to accepting infinite IN requests, this can still be changed by calling the existing \ref Pipe_SetFiniteINRequests() function. 2009-06-23 08:03:09 +00:00
Dean Camera feabfd12ce Fix makefiles -- the auto-addition of -D switches to each LUFA compile time option was faulty, due to GNUMake becomming confused by the spaces in the USE_STATIC_OPTIONS lines. Make user add in the switches explicitly instead. 2009-06-19 05:08:04 +00:00
Dean Camera beb0b2bda0 Move LUFA compile time options to a new section in the application makefiles for clarity. 2009-06-19 04:34:35 +00:00
Dean Camera dfa547164a Extend USB_GetDeviceConfigDescriptor() routine to require the configuration number within the device to fetch, to add support for multi-configuration devices. 2009-06-19 03:37:47 +00:00
Dean Camera e338cb6f32 Added new USB_Host_ClearPipeStall() convenience function to clear a stall condition on an attached device's endpoint.
Added new USB_Host_GetDeviceDescriptor() convenience function to retrieve the attached device's Device descriptor.

Make Pipe_ConfigurePipe() mask the given endpoint number against PIPE_EPNUM_MASK to ensure the endpoint IN direction bit is cleared to prevent endpoint type corruption.

Fix documentation mentioning Pipe_GetCurrentToken() function when real name is Pipe_GetPipeToken().
2009-06-18 07:53:51 +00:00
Dean Camera 4d3a594f3e Changed per-device controller preprocessor checks over to per-device series for better device control.
Fixed error in Endpoint.c using HSOFI rather than SOFI for counting elapsed milliseconds.
2009-06-14 07:44:02 +00:00
Dean Camera 6be24e4404 Fixes to the MIDI device demos (ClassDriver, LowLevel); discard unused read-in events from the host, use standard MIDI event structure in low level demo rather than sending individual bytes. 2009-06-10 05:03:45 +00:00