Changeset 30758


Ignore:
Timestamp:
10/30/14 19:29:22 (9 years ago)
Author:
gost
Message:

fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/global.h

    r30757 r30758  
    253253                }
    254254#else
    255                 char* cmd = NULL;
    256                 cmd = ostrcat(cmd, "echo -e -n ", 1, 0);       
    257                 cmd = ostrcat(cmd, "\"\\x0f\\x01", 0, 0);
     255                unsigned char data[3];
     256                int hdmiFd = open("/dev/hdmi_cec", O_RDWR | O_NONBLOCK);
     257               
     258                data[0] = 0x0f;
     259                data[1] = 0x01;
     260
    258261                if(flag == 0)
    259                         cmd = ostrcat(cmd, "\\x04\" > /dev/hdmi_cec", 0, 0);
     262                        data[2] = 0x04;
    260263                else
    261                         cmd = ostrcat(cmd, "\\x36\" > /dev/hdmi_cec", 0, 0);
    262                 }
    263                 system(cmd);
    264                 free cmd;
     264                        data[2] = 0x36;
     265                if(hdmiFd > 0)
     266                {
     267                        write(hdmiFd, &data, 3);
     268                        close(hdmiFd)
     269                }
    265270#endif
    266271        }
    267        
    268        
    269        
    270         echo -e -n "\x0f\x01\x04" > /dev/hdmi_cec
    271 
    272272        return 0;
    273273}
Note: See TracChangeset for help on using the changeset viewer.