{"action":"opened","issue":{"url":"https://api.github.com/repos/ev3dev/ev3dev-lang/issues/141","labels_url":"https://api.github.com/repos/ev3dev/ev3dev-lang/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/ev3dev/ev3dev-lang/issues/141/comments","events_url":"https://api.github.com/repos/ev3dev/ev3dev-lang/issues/141/events","html_url":"https://github.com/ev3dev/ev3dev-lang/issues/141","id":123331161,"number":141,"title":"Get platform-specific features fully implemented in spec","user":{"login":"WasabiFan","id":3310349,"avatar_url":"https://avatars.githubusercontent.com/u/3310349?v=3","gravatar_id":"","url":"https://api.github.com/users/WasabiFan","html_url":"https://github.com/WasabiFan","followers_url":"https://api.github.com/users/WasabiFan/followers","following_url":"https://api.github.com/users/WasabiFan/following{/other_user}","gists_url":"https://api.github.com/users/WasabiFan/gists{/gist_id}","starred_url":"https://api.github.com/users/WasabiFan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WasabiFan/subscriptions","organizations_url":"https://api.github.com/users/WasabiFan/orgs","repos_url":"https://api.github.com/users/WasabiFan/repos","events_url":"https://api.github.com/users/WasabiFan/events{/privacy}","received_events_url":"https://api.github.com/users/WasabiFan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ev3dev/ev3dev-lang/labels/all%20languages","name":"all languages","color":"eb6420"},{"url":"https://api.github.com/repos/ev3dev/ev3dev-lang/labels/Spec","name":"Spec","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-21T18:17:34Z","updated_at":"2015-12-21T18:17:34Z","closed_at":null,"body":"So far, we have had some discussions on platform uniformity and such in various issues (e.g. #115 and ev3dev/ev3dev#412). I think we should get the rest of the platform functionality figured out now to make sure that all platforms are supported.\r\n\r\n@dlech said in #115\r\n> I would like the same program to run on any platform without having to make any changes.\r\n\r\nSo, keeping that as a goal, how can we get our API updated?\r\n\r\n### LEDs\r\n\r\nFor LEDs, we still need to allow specific control of just single LEDs and colors. However, I imagine that if we could get some default common actions/states implemented cross-platform we could allow programs to run cross-platform without modification (at least until they need more fine-grained control). I am imagining utility methods like this:\r\n\r\nPossible name | Meaning | EV3 action | BrickPi action | PiStorms action\r\n--------------------|-----|-------|-----|---\r\nsuccess | Success | green | both on solid | green\r\nwarning | Warning/danger | amber or red | both flashing (rapidly) | amber or red\r\nprogress | Indicate specified % | Fade from red to green | special (see below) | Fade from red to green\r\n\r\nI'm imagining the \"special\" case above to be:\r\n- From 0% to 50%, increasing blink rate of 1st LED while 2nd off\r\n- From 50% to 95%, Increasing blink rate of 2nd LED while 1st is ON\r\n- >95% both on\r\n\r\n...But that depends on how triggers react to being repeatedly set (we may need to group it in 25% increments).\r\n\r\nWith a scheme such as this, programs could use these interfaces for simple tasks and wouldn't need to break platform compatibility in the process.\r\n\r\n### Buttons\r\n\r\nI think that it is important to accept up-front that the buttons can't be very universal. Only the EV3 has 6 buttons; the others have 0 and 1. So, I think this just needs to stay separate, unfortunately.\r\n\r\n### PowerSupply\r\n\r\nI think that it's best if we just have the PowerSupply default to using whichever platform device it finds first. That would be `legoev3-battery`, `brickpi-battery`, or `pistorms-battery`.\r\n\r\n### Ports\r\n\r\nAlthough EV3 and BrickPi are uniform, PiStorms has 4 ports with different labeling. Optimally, we would use `OUTPUT_A`, `INPUT_1`, etc. for all platforms, so I think we should use some sort of mapping: Declare that BAS1 is port 1, for example, and handle the internal naming differences with extra code (which would depend on the platform).\r\n\r\n### Display/sound\r\n\r\nPlatform-agnostic by default, so doesn't matter.\r\n\r\n--------\r\n\r\nSo, what are your thoughts? @ddemidov @rhempel \r\n**CC** @dlech "}}