An IO interface is a component for SAMI which enables input and/or output to external hardware or services. Some examples of IO interfaces include one which gathers movie showtimes, one which controls light switches, and one that controls the TV. IO interfaces may implement an interface which is accessible to outside apps, so that many different apps can use the component, with different interfaces or new functionality. These interfaces may also be implemented by many different IO interfaces, so that things like the brand of light switches are hidden from the user of an app that turns on or off a light switch. SAMI comes with some common interfaces already, along with a sample implementation of that interface, but we will be adding more to the SDK as time goes on, and we encourage you to make interfaces you see we are lacking, and share them with the community, so that more people can enjoy SAMI! The only requirement is that no matter which interface you use, it must inherit from IIOInterface.
IOInterfaces are pretty open as to how you create it. The only real requirement is that it implements an interface that can be used to look up the IO interface by apps. This interface should implement IIOInterface, and should be persistent.
There are a few base classes created to make it easier to create IO interfaces for the common cases. Below is a list of these base classes, along with links to associated documentation.
Using a component is almost as easy. You just get an instance of the singleton ConfigurationManager, and call FindAllComponentsOfType<T>(). Below is an example that gets all of the light switch components:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ConfigurationManager.GetInstance().FindAllComponentsOfType<ILightSwitchController>()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Documentation: Audio File-Based IO Interface
Documentation: Developing for SAMI
Documentation: Home
Documentation: Loading Configuration Data
Documentation: Streaming Audio IO Interface
Documentation: XBee IO Interface