@ -23,28 +23,14 @@ namespace KaleidoscopePlugins {
namespace HostOS {
namespace HostOS {
bool
bool
Focus ( const char * command ) {
Focus ( const char * command ) {
enum {
if ( strcmp_P ( command , PSTR ( " hostos.type " ) ) ! = 0 )
GET ,
SET ,
} subCommand ;
if ( strncmp_P ( command , PSTR ( " hostos. " ) , 7 ) ! = 0 )
return false ;
if ( strcmp_P ( command + 7 , PSTR ( " type " ) ) = = 0 )
subCommand = GET ;
else if ( strcmp_P ( command + 7 , PSTR ( " set " ) ) = = 0 )
subCommand = SET ;
else
return false ;
return false ;
switch ( subCommand ) {
if ( Serial . peek ( ) = = ' \n ' ) {
case GET :
Serial . println ( : : HostOS . os ( ) ) ;
Serial . println ( : : HostOS . os ( ) ) ;
break ;
} else {
case SET :
uint8_t os = Serial . parseInt ( ) ;
uint8_t os = Serial . parseInt ( ) ;
: : HostOS . os ( ( KaleidoscopePlugins : : HostOS : : Type ) os ) ;
: : HostOS . os ( ( KaleidoscopePlugins : : HostOS : : Type ) os ) ;
break ;
}
}
Serial . read ( ) ;
Serial . read ( ) ;