{"action":"created","issue":{"url":"https://api.github.com/repos/anidev/frc-driverstation/issues/6","labels_url":"https://api.github.com/repos/anidev/frc-driverstation/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/anidev/frc-driverstation/issues/6/comments","events_url":"https://api.github.com/repos/anidev/frc-driverstation/issues/6/events","html_url":"https://github.com/anidev/frc-driverstation/issues/6","id":53483437,"number":6,"title":"Switch between different protocol versions","user":{"login":"anidev","id":894407,"avatar_url":"https://avatars.githubusercontent.com/u/894407?v=3","gravatar_id":"","url":"https://api.github.com/users/anidev","html_url":"https://github.com/anidev","followers_url":"https://api.github.com/users/anidev/followers","following_url":"https://api.github.com/users/anidev/following{/other_user}","gists_url":"https://api.github.com/users/anidev/gists{/gist_id}","starred_url":"https://api.github.com/users/anidev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anidev/subscriptions","organizations_url":"https://api.github.com/users/anidev/orgs","repos_url":"https://api.github.com/users/anidev/repos","events_url":"https://api.github.com/users/anidev/events{/privacy}","received_events_url":"https://api.github.com/users/anidev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/anidev/frc-driverstation/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-06T05:44:38Z","updated_at":"2015-01-21T04:02:56Z","closed_at":null,"body":"Implement a simple means to switch between multiple versions of the communication protocol. The protocol changed with the introduction of the roboRIO in 2015, though I don't know how big a change it was. \r\n\r\nFixing this issue will require implementing the switching both in the API as well as in the GUI(s). There are potentially many different ways this could be done, which can be discussed here."},"comment":{"url":"https://api.github.com/repos/anidev/frc-driverstation/issues/comments/70781311","html_url":"https://github.com/anidev/frc-driverstation/issues/6#issuecomment-70781311","issue_url":"https://api.github.com/repos/anidev/frc-driverstation/issues/6","id":70781311,"user":{"login":"anidev","id":894407,"avatar_url":"https://avatars.githubusercontent.com/u/894407?v=3","gravatar_id":"","url":"https://api.github.com/users/anidev","html_url":"https://github.com/anidev","followers_url":"https://api.github.com/users/anidev/followers","following_url":"https://api.github.com/users/anidev/following{/other_user}","gists_url":"https://api.github.com/users/anidev/gists{/gist_id}","starred_url":"https://api.github.com/users/anidev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anidev/subscriptions","organizations_url":"https://api.github.com/users/anidev/orgs","repos_url":"https://api.github.com/users/anidev/repos","events_url":"https://api.github.com/users/anidev/events{/privacy}","received_events_url":"https://api.github.com/users/anidev/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T04:02:56Z","updated_at":"2015-01-21T04:02:56Z","body":"The FRCCommunication class can be used for all protocol versions, with only minor changes if necessary. Ideally, this is how I think we should go about implementing this.\r\n\r\nWe create a new, higher level backend API that does not directly interact with the protocol classes, as they do now. For example, instead of using a ControlFlags class, just have some methods like setEnabled or setEmergencyStop. These methods will be declared in an interface. A similar interface will be created for the received data. Each protocol version will have its own package, with a class that implements the two interfaces, along with whatever other classes they needs (that shouldn't be accessed by the frontend). Each one of these implementing classes will control how to serialize/deserialize that data. Probably, we can reuse the existing FRCCommonControl and FRCRobotControl objects for that. We will also need to improve the existing Joystick class to be generic and protocol agnostic, in the same package as the two interfaces. This way one Joystick class can be shared between all protocols, with the specific protocol implementation deciding how to serialize/deserialize it. Finally, we have one additional class in the main package that picks the appropriate protocol version, initializes the appropriate class (potentially through reflection), and returns it. (As an alternative to the Joystick idea I mentioned, we can instead make a Joystick interface, specific implementations for the Joystick, and have this class intialize the correct Joystick implementation and return that as well. I prefer the first option over this).\r\n\r\nStructure:\r\n````\r\nFRCDS-Java-Comm/\r\n|- org.anidev.frcds.proto/\r\n   |- interface RobotControlData\r\n   |- interface RobotStatusData\r\n   |- class Joystick\r\n   |- class ProtoclFactory\r\n   |- cRIO2014/\r\n      |- class CRIOControlData implements RobotControlData\r\n      |- class CRIOStatusData implements RobotStatusData\r\n      |- other classes\r\n   |- roboRIO2015/\r\n      |- class RoboRIOControlData implements RobotControlData\r\n      |- class RoboRIOStatusData implements RobotStatusData\r\n      |- other classes\r\n````\r\n\r\nThoughts?"}}