{"id":285062,"date":"2017-04-17T10:15:28","date_gmt":"2017-04-17T06:15:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=285062"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=285062","title":{"rendered":"\u041a\u0430\u043a \u0437\u0430\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u043d\u0441\u043e\u0440 \u0432 Android OS"},"content":{"rendered":"<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/5cc\/51f\/5c5\/5cc51f5c5f144d08bd8e7d5afb2254f6.png\" \/><\/div>\n<p>  \u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0441\u0438\u0434\u0435\u043b\u0438 \u0438 \u043f\u0438\u0441\u0430\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0439 \u0441\u0435\u043d\u0441\u043e\u0440 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0430\u043c\u0438. \u0418 \u0432\u0434\u0440\u0443\u0433 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0441\u0435\u043d\u0441\u043e\u0440 \u0445\u043e\u0447\u0435\u0442 \u0441\u0435\u0431\u0435 \u043e\u0434\u0438\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u0422\u0430\u043a \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c I2C\/GPIO \u0441\u0435\u043d\u0441\u043e\u0440 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Android OS, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0435\u043d\u0441\u043e\u0440 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0438\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0430\u043c\u043e\u0433\u043e \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/p>\n<p>  \u0411\u0443\u0434\u0443\u0447\u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u043c \u0441\u0443\u0431\u043f\u043e\u0434\u0440\u044f\u0434\u043e\u043c, \u043d\u0430\u0434\u0435\u0436\u0434\u044b \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043e\u0442\u043a\u043b\u0438\u043a \u043e\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e, \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u0448\u043a\u0430\u0445 \u0438 \u0437\u0430\u0441\u0443\u043d\u0443\u0442\u044c \u043d\u0430\u0448\u0443 \u0436\u0435\u043b\u0435\u0437\u044f\u043a\u0443 \u0432 \u043a\u0430\u043a\u043e\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441 Android.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442, \u0441\u0445\u0435\u043c\u0443 \u043a \u043d\u0435\u043c\u0443, \u043f\u0440\u0438\u043f\u0430\u044f\u0442\u044c\u0441\u044f \u043a\u0443\u0434\u0430 \u043d\u0430\u0434\u043e, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0432, \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043b\u0430\u0433\u043e\u0442\u0432\u043e\u0440\u043d\u043e \u0441\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u043d\u0441\u043e\u0440\u0430 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>  \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0447\u0442\u043e \u0442\u0443\u0442 \u0435\u0441\u0442\u044c:<\/p>\n<ol>\n<li>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/li>\n<li>\u041a\u0430\u043a \u0436\u0435\u043b\u0435\u0437\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0434\u0435\u0432\u0430\u0439\u0441\u0443 \u0442\u0438\u043f\u0430 \u043f\u043b\u0430\u043d\u0448\u0435\u0442<\/li>\n<li>\u041a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u043a \u0434\u0435\u0431\u0430\u0436\u043d\u043e\u043c\u0443 UART \u0432 \u0430\u0443\u0434\u0438\u043e \u0432\u044b\u0445\u043e\u0434\u0435 \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/li>\n<li>\u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u044f\u0434\u0440\u0430 \u0441 I2C, GPIO, \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u0444\u043e\u043d\u043e\u0432\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438<\/li>\n<li>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u0441\u0432\u043e\u0435\u0439 \u0436\u0435\u043b\u0435\u0437\u043a\u0438 \u0432 Android middleware \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e<\/li>\n<li>\u041a\u0430\u043a \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u043a\u0443\u0434\u0430 \u0447\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u0438 \u043d\u0430\u0448\u0451\u043b\u0441\u044f<\/li>\n<li>\u041a\u0430\u043a \u043f\u0440\u043e\u0440\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 SEAndroid\/SELinux \u0434\u043e\u043f\u0438\u0441\u0430\u0432 \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430<\/li>\n<li>\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u2014 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043f\u043f<\/li>\n<li>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0451 \u0441\u043e\u0431\u0440\u0430\u0442\u044c<\/li>\n<li>\u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0443\u043d\u043a\u0442\u0430\u0445 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a<\/li>\n<\/ol>\n<p>  <b>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/b><\/p>\n<p>  \u0414\u0435\u043b\u043e, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u0435 \u0432\u0441\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b, \u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0438\u0445 \u0434\u043b\u044f \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0430 \u0432\u044b\u0431\u043e\u0440 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 Nexus 7 \u043f\u043e \u0440\u044f\u0434\u0443 \u043f\u0440\u043e\u0438\u0437\u0430\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u0447\u0438\u043d: \u043e\u043d \u0431\u044b\u043b \u0443 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e \u0438 \u0431\u044b\u043b \u0435\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u044b\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0431\u0438\u0442 \u043c\u043e\u043b\u044c\u044e (\u043c\u043e\u043b\u044c \u0440\u0430\u0437\u0431\u0438\u043b\u0430 \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u044b\u0448\u044c\u044e), \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u044d\u0442\u043e Nexus, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u043e \u043d\u0435\u043c\u0443 \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043d\u0430 \u0433\u0443\u0433\u043b\u043e\u0432\u0441\u043a\u0438\u0445 \u0441\u0430\u0439\u0442\u0430\u0445. \u0422\u0430\u043a \u043a\u0430\u043a \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u0437\u0430 \u043f\u043b\u0430\u043d\u0448\u0435\u0442 \u0431\u044b\u043b\u043e \u0431\u043e\u044f\u0437\u043d\u043e, \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u043e\u0434 \u0437\u0430\u043c\u0435\u0441 \u043f\u043e\u043f\u0430\u043b Raspberry Pi3. \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043d\u0430 \u043d\u0451\u043c. \u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c Raspberry Pi 3, \u043d\u043e \u0432 \u0443\u043c\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c, \u0447\u0442\u043e \u0431O\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u043e\u0440\u0435\u0448\u0430\u043b\u0430\u0441\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0451\u043c.<\/p>\n<p>  <b>\u041a\u0430\u043a \u0436\u0435\u043b\u0435\u0437\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0434\u0435\u0432\u0430\u0439\u0441\u0443 \u0442\u0438\u043f\u0430 \u043f\u043b\u0430\u043d\u0448\u0435\u0442<\/b><\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u043d\u0430\u0432\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 \u043a\u0430\u043a \u043f\u043b\u0430\u043d\u0448\u0435\u0442 \u0431\u0435\u0437 \u0441\u0445\u0435\u043c\u044b \u2014 <s>\u0441\u043b\u0430\u0431\u043e\u0443\u043c\u0438\u0435 \u0438 \u043e\u0442\u0432\u0430\u0433\u0430<\/s> \u0434\u0435\u043b\u043e \u043d\u0435\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u044b\u043b\u0430 \u0441\u0445\u0435\u043c\u0430. \u0412\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u043b\u0435\u043a\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0445\u0435\u043c\u044b \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u043e\u0432 \u2014 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u0432\u0435\u0449\u044c, \u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u0438 \u043d\u0435 \u0431\u043e\u044f\u0442\u044c\u0441\u044f \u043e\u0431\u0438\u043b\u0438\u044f \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0432 \u043e\u043a\u043d\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0438 \u043d\u0430\u0439\u0442\u0438. \u041c\u044b \u043d\u0430\u0448\u043b\u0438 \u0435\u0451 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0433\u0434\u0435-\u0442\u043e <a href=\"http:\/\/wenku.baidu.com\/view\/7c59c71ac281e53a5802ff15.html\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0437\u0430\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0445\u0435\u043c\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u044b\u0440\u0435\u0437\u043a\u0430\u043c\u0438 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u044b-\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>  \u041f\u043e \u0438\u0434\u0435\u0435, \u0432 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0448\u0438\u043d I2C \u0438 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u044f\u043a\u0438\u0445 GPIO, \u043d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0435, \u043f\u0440\u0438\u043f\u0430\u044f\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u0438\u0442\u044f\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0443\u0440\u043e\u0432\u043d\u044e. \u041a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0430\u0445 Nexus 7 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u0434\u043d\u044f\u044f \u043a\u0430\u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 I2C \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u0432\u0430 \u043f\u0438\u043d\u0430 (\u043f\u0438\u0442\u0430\u043d\u0438\u0435 \u0438 \u0440\u0435\u0441\u0435\u0442). \u0410 \u043d\u0430\u043c \u0438 \u043d\u0430\u0434\u043e I2C \u0438 2 GPIO (\u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0432\u043a\u043b\/\u0432\u044b\u043a\u043b \u0441\u043f\u044f\u0449\u0435\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u043b\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0447\u0451\u0442 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b).<\/p>\n<p>  \u0421\u043e\u043e\u0442\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441\u0445\u0435\u043c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e, \u0447\u0442\u043e \u0432\u0441\u0451 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0430. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0440\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 Nexus 7:<\/p>\n<ol>\n<li>\u0412\u0435\u0440\u0441\u0438\u044f 2013 \u0433\u043e\u0434\u0430 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u043c\u0438 \u0441\u0445\u0435\u043c\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u0438 \u043a\u0443\u0447\u0443 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043c\u0435\u043b\u043a\u0438\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439<\/li>\n<li>\u0412\u0435\u0440\u0441\u0438\u0438 2012 \u0433\u043e\u0434\u0430 .1 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0441\u043f\u0430\u044f\u043d\u043d\u043e\u0435 \u043f\u043e\u0441\u0430\u0434\u043e\u0447\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0437\u0430\u0434\u043d\u0435\u0439 \u043a\u0430\u043c\u0435\u0440\u044b \u0438 \u0432\u0441\u0451 \u0432 \u043d\u0435\u0439 \u0445\u043e\u0440\u043e\u0448\u043e<\/li>\n<li>\u0412\u0435\u0440\u0441\u0438\u0438 2012 \u0433\u043e\u0434\u0430 .2 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0441\u043f\u0430\u044f\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0438 \u043f\u0440\u0438\u043f\u0430\u044f\u0442\u044c\u0441\u044f \u0442\u0443\u0434\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435.<\/li>\n<\/ol>\n<p>  \u0423 \u043d\u0430\u0441 \u0431\u044b\u043b \u043f\u043b\u0430\u043d\u0448\u0435\u0442 2012 \u0433\u043e\u0434\u0430, \u0433\u0434\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u044a\u0435\u043c\u0430, \u0438 \u0432\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0440\u0430\u0437\u0431\u0438\u0442\u044b\u0439 touch \u0438 \u043c\u044b\u0448\u044c \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435, \u0447\u0442\u043e \u043f\u043e\u0440\u043e\u044e \u0441\u0438\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u043e. \u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043b\u044f\u0441\u043e\u043a \u0441 \u0431\u0443\u0431\u043d\u043e\u043c \u0432\u043e\u043a\u0440\u0443\u0433 \u0434\u0430 \u043e\u043a\u043e\u043b\u043e, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043a\u0443\u043f\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441 \u0440\u0430\u0441\u043f\u0430\u044f\u043d\u043d\u044b\u043c \u0440\u0430\u0437\u044a\u0435\u043c\u043e\u043c. \u041d\u043e\u0432\u044b\u0445 Nexus 7 \u0434\u0430\u0432\u043d\u043e \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043a\u0430\u043b\u0438 \u043d\u0430 \u00ab\u0431\u0430\u0437\u0430\u0440\u0430\u0445\u00bb, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043f\u043e\u0434 \u043a\u0440\u044b\u0448\u043a\u0443 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0441 \u0440\u0430\u0441\u043f\u0430\u044f\u043d\u043d\u044b\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u043f\u043e\u0434 \u043a\u0430\u043c\u0435\u0440\u0443.<\/p>\n<p>  \u041d\u043e\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0448\u0438\u043d\u044b I2C \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u0446\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c NDK. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0443\u0442\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Android \u0438 chmod \u043a\u043e\u043b\u0434\u043e\u0432\u0441\u0442\u0432\u043e\u043c \u0447\u0435\u0440\u0435\u0437 adb \u043e\u0442\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043b\u044e \u0432\u0441\u0435 I2C \u0448\u0438\u043d\u044b. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0441 \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438 \u043d\u0430 \u0448\u0438\u043d\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u044b\u043b\u0438 \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438 \u043e\u0442\u043b\u0443\u043f \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0448\u0438\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u043b\u043e.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041b\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0434\u0435\u0442\u0430\u043b\u044c\u044e \u0441\u0442\u0430\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Android \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u0440\u0443\u0442\u043e\u0432\u0430\u043d\u0438\u044f: \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u0430\u043c\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0431\u044b\u043b Android 5.1.1. \u041f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0440\u0443\u0442\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0451 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b\u043b\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0432\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0443 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043a \u043f\u0430\u043f\u043a\u0435 \/dev \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0431\u044b\u043b\u043e. \u041d\u0430\u0441\u0438\u043b\u044c\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c adb shell \u0438 chmod \u044d\u0444\u0444\u0435\u043a\u0442\u0430 \u043d\u0435 \u0434\u0430\u043b\u043e. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u0438\u0445 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439 \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0434\u043e Android 4.4.4. \u041f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0436\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0443\u0442\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u0434\u0430\u043b\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \/dev. \u0415\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 adb shell \u043f\u0430\u043f\u043a\u0430 \/dev \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 4.4.4 \u0431\u044b\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 super user, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0432 Android 5.1.1 \u043d\u0435\u0442. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u043f\u043e \u0447\u0430\u0441\u0442\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u041e\u0421 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043e\u0442 Android 4 \u043a Android 5 \u0438 \u0434\u0430\u043b\u0435\u0435 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0442\u0440\u0435\u0442\u0438\u0439 \u043f\u0443\u043d\u043a\u0442 \u043f\u043e <a href=\"https:\/\/source.android.com\/security\/enhancements\/enhancements50.html\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>).<\/div>\n<\/div>\n<p>  \u0410 \u0447\u0442\u043e GPIO?<\/p>\n<p>  \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043d\u0430\u0448\u0435\u0439 \u0441\u0445\u0435\u043c\u044b \u0432 \u043e\u0431\u0449\u0435\u043c \u043e\u0431\u043e\u0437\u0440\u0435\u043d\u0438\u0438 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abRear camera module OV5650\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7e0\/b83\/b60\/7e0b83b60c024da3a5b8e1019427ac28.png\"\/><\/p>\n<p>  \u0422\u0430\u043c \u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u043e\u0432\u0430\u043d\u043e, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043a tegra T30L (\u0442.\u0435. \u0433\u043b\u0430\u0432\u043d\u044b\u0439 SoC). \u0420\u044f\u0434\u043e\u043c \u0435\u0441\u0442\u044c \u043b\u0438\u043d\u0438\u0438 I2C_CAM_\u2026 \u041f\u043e\u0438\u0449\u0435\u043c\u2026<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f97\/e74\/5ea\/f97e745ea4f24c83b409efefefe0a76b.png\"\/><\/p>\n<p>  \u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 9 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e. \u041f\u043e\u0447\u0442\u0438 \u0432\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u0437\u0430\u0434\u043d\u0435\u0439 \u043a\u0430\u043c\u0435\u0440\u0430\u043c. \u0422\u0430\u043c \u0436\u0435 \u0435\u0441\u0442\u044c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0443 \u043a\u0430\u043c\u0435\u0440\u044b \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0438\u043d\u0430 CAM_RST_5M \u0438 PWDN_5M, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0445\u043e\u0434\u044f\u0442 \u0432 SoC \u043d\u0430 GPIO_PBB0 \u0438 GPIO_PBB5 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041a\u0430\u0436\u0435\u0442\u0441\u044f \u2014 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e. \u0422\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a \u0442\u0443\u0434\u0430 \u043f\u0440\u0438\u043f\u0430\u044f\u0442\u044c\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c\u2026<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/92d\/d1d\/ef2\/92dd1def24ad4a0b9189150c455cd483.png\"\/><\/p>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0451. \u041d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 FFC \u0440\u0430\u0437\u044a\u0451\u043c\u0430, \u043a\u0443\u0434\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043c\u0435\u0440\u0430, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0435 \u043f\u0438\u043d\u044b. \u041d\u0430 \u043d\u0430\u0448\u0435\u043c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0435 \u0440\u0430\u0437\u044a\u0451\u043c \u043d\u0435 \u0440\u0430\u0441\u043f\u0430\u044f\u043d. \u041d\u043e \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043b\u0430\u043d\u0448\u0435\u0442 \u0441 \u0440\u0430\u0437\u044a\u0435\u043c\u043e\u043c, \u0434\u0430\u0431\u044b \u043d\u0435 \u043c\u0443\u0447\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043f\u0438\u043d\u043e\u0432 \u0432\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0443\u0436\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u043f\u0440\u043e \u044d\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u2026<\/p>\n<p>  <b>\u041a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u043a \u0434\u0435\u0431\u0430\u0436\u043d\u043e\u043c\u0443 UART \u0432 \u0430\u0443\u0434\u0438\u043e \u0432\u044b\u0445\u043e\u0434\u0435 \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/b><\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043f\u0438\u0448\u0435\u0448\u044c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438 \u0432\u0441\u044f\u043a\u043e\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u041fO \u043f\u043e\u0434 \u043b\u0438\u043d\u0443\u043a\u0441 (\u043a\u0440\u0430\u0439\u043d\u0435) \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u043b\u043e\u0433 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u044f\u0434\u0440\u0430\/\u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043d\u0430\u0448 \u0434\u0440\u0430\u0439\u0432\u0435\u0440. \u0418 \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e-\u0442\u043e \u0438\u0434\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a, \u0432\u0441\u0451 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e.<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u043a\u0443\u0440\u0438\u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u044b, \u043c\u044b \u0440\u0430\u0437\u0443\u0437\u043d\u0430\u043b\u0438, \u0447\u0442\u043e Nexus \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u044e\u0442 \u0434\u0435\u0431\u0430\u0436\u043d\u044b\u0439 UART \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u0447\u0435\u0440\u0435\u0437 \u0430\u0443\u0434\u0438\u043e \u0440\u0430\u0437\u044a\u0451\u043c. \u0418 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043d\u043e \u0442\u0438\u043f\u0430 \u0441\u0430\u043c\u043e \u0431\u0435\u0437\u043e \u0432\u0441\u044f\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ul>\n<li>\u0412 \u0430\u0443\u0434\u0438\u043e\u0440\u0430\u0437\u044a\u0435\u043c\u0435 \u043f\u043e \u043a\u0430\u043d\u0430\u043b\u0443 MIC \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u043e\u043b\u0435\u0435 3\u0412.<\/li>\n<li>\u0412 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 MIC \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 1.8\u0412-2.9\u0412.<\/li>\n<li>\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u044f\u0434\u0440\u0443, \u0447\u0442\u043e \u043d\u0430 \u0430\u0443\u0434\u0438\u043e \u0440\u0430\u0437\u044a\u0435\u043c\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0443\u043b\u0438\u0442 \u0434\u0435\u0431\u0430\u0433.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043b\u0435\u0432\u044b\u0439 \u0438 \u043f\u0440\u0430\u0432\u044b\u0439 \u043a\u0430\u043d\u0430\u043b\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f RX \u0438 TX \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0445\u043e\u0442\u044f \u0438 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 1.8\u0412 \u2014 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ae2\/6fb\/6e9\/ae26fb6e960e47a38db4a6bf634f0348.png\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a92\/5ac\/66b\/a925ac66b4a74b1487eaac7ac7d4f6c7.png\"\/><\/p>\n<p>  \u041d\u0430 \u0440\u0430\u0434\u043e\u0441\u0442\u044f\u0445 \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u0438\u043a USB-UART -&gt; Audio. \u041c\u044b \u0435\u0433\u043e \u0432\u043e\u0442\u043a\u043d\u0443\u043b\u0438, \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 Ubuntu minicom, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442 \u0438\u2026 \u043d\u0438\u0447\u0435\u0433\u043e. \u0412\u043e\u043e\u0431\u0449\u0435. \u0422\u043e \u0435\u0441\u0442\u044c, \u0441\u043e\u0432\u0441\u0435\u043c. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043d\u0430\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u043e\u0438\u0441\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435, debug uart \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u0438\u043d\u0438\u0438 \u043b\u0435\u0432\u043e\u0433\u043e \u0438 \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u043d\u0435 \u0432\u044b\u0448\u043b\u0438 \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f RX\/TX. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u0438\u0437 fastboot, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u0443\u0441\u043f\u043e\u043a\u043e\u0438\u043b\u043e \u043d\u0430\u0441 \u0432 \u043a\u043e\u043d\u0446\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0442\u0435\u0438 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u0447\u0442\u043e <a href=\"http:\/\/www.abclinuxu.cz\/blog\/Lorris\/2013\/12\/serial-console-on-google-nexus-5\">\u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0447\u0435\u043b\u043e\u0432\u0435\u043a<\/a> \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0440\u0430\u0437\u043d\u044b\u0435 Nexus`\u044b, \u0438 \u043d\u0430 \u0432\u0441\u0435\u0445, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0436\u0435 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0430 UART \u0437\u0430\u0432\u0451\u043b\u0441\u044f, \u0430 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u2014 \u043d\u0435\u0442. \u041d\u043e \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e.<\/p>\n<p>  \u0415\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0431\u044b\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u0431\u0430\u0436\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043d\u043e \u0432 \u044d\u0442\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043d\u0435 \u043f\u043e\u0448\u043b\u0438, \u0445\u043e\u0442\u044f \u0441\u0445\u0435\u043c\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0430 \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435, \u043d\u0430\u0448\u0438\u043c \u0441\u043f\u0430\u0441\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u043b\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Raspberry Pi \u0434\u043b\u044f \u0432\u043c\u0435\u0441\u0442\u0438\u043b\u0438\u0449\u0430 Android. \u0422\u0430\u043c \u0434\u0435\u0431\u0430\u0436\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043e\u0442\u043b\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0430 Nexus \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u043c\u0435\u043d\u044f\u0442\u044c, \u0435\u0441\u043b\u0438 \u044f\u0434\u0440\u043e \u043d\u0435 \u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f. \u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u0442\u044f\u0436\u0435\u043a \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u044b\u043b\u043e \u0438\u0437-\u0437\u0430 \u043d\u0435\u043f\u0440\u043e\u043f\u0430\u044f\u043d\u043d\u044b\u0445 \u043f\u0438\u043d\u043e\u0432 GPIO, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 tegra3 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GPIO.<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043b\u043e\u0433 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c c \u043f\u043e\u043c\u043e\u0449\u044c\u044e adb bugreport.<\/p>\n<p>  <b>\u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u044f\u0434\u0440\u0430 \u0441 I2C, GPIO, \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u0444\u043e\u043d\u043e\u0432\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438<\/b><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u044f\u0434\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0443\u043b\u0438\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0447\u0435\u0440\u0435\u0437 I2C \u0438 GPIO, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 \/dev \u043a\u0430\u043a\u0438\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043c Android middleware \u0441\u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443\/\u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443 \u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c.<\/p>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430:<\/p>\n<ul>\n<li>\u0414\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u044f\u0434\u0440\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u043e\u0439 \u2014 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f (\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430, \u0448\u0438\u043d\u044b) \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 (\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438).<\/li>\n<li>\u0426\u0435\u043f\u043e\u0447\u043a\u0430 \u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f device tree \u0438\u043b\u0438 \u0421\u0438 \u043a\u043e\u0434\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0435\u0441\u043b\u0438 device tree \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u044f\u0434\u0440\u0430 \u0438\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443 \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0434\u0440\u0430. \u041d\u0430\u0448 \u0441\u043b\u0443\u0447\u0430\u0439 \u0441 tegra3 \u2014 \u0432\u0442\u043e\u0440\u043e\u0439.<\/li>\n<li>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 i2c \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 I2C \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0435\u0439, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e probe, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430, \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043a\u043e\u0434\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u0441\u043f\u0438\u0441\u043a\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 i2c_add_driver.<\/li>\n<\/ul>\n<p>  \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u044b\u043b\u043a\u0430\u0445 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430. \u0442.\u0435. \u043e \u043a\u043e\u0434\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>  Nexus 7 2012 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 Tegra3. \u042f\u0434\u0440\u043e \u043d\u0430 \u043d\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0435 \u043d\u043e\u0432\u043e\u0435 (3.1.\u0447.\u0447) \u0438 \u0431\u0435\u0437 device tree. \u0410 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432\u0441\u0451 \u0436\u0435\u043b\u0435\u0437\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0421\u0438 \u043a\u043e\u0434\u043e\u043c \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u043d\u043e \u0432 \/kernel\/tegra\/arch\/arm\/mach-tegra\/<\/p>\n<p>  \u0424\u0430\u0439\u043b board-grouper-pinmux.c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0436\u0435\u043b\u0435\u0437\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 \u043f\u0438\u043d\u043e\u0432 SoC, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0431\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0438\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f\u0434\u0440\u0430 \u043e\u0442 nVidia (\u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u043b\u043e\u0432\u043e\u043c \u00abtegra\u00bb \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f\u0434\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0432\u0438\u0434\u0435). \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u0430\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">board-grouper-pinmux.c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/ ...  \/\/ \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0438\u043d\u043e\u0432 \/\/ \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442 \u043d\u0438\u0436\u0435 \u0443\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0441 \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0437\u0440\u044f, \/\/ \u043a\u043e\u0434 \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u0440\u0430\u0431\u043e\u0447\u0438\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u043f\u0438\u043d\u043e\u0432  \/* We are disabling this code for now. *\/ #define GPIO_INIT_PIN_MODE(_gpio, _is_input, _value)  \\    {              \\       .gpio_nr = _gpio, \\       .is_input   = _is_input,   \\       .value      = _value,   \\    }  static struct gpio_init_pin_info init_gpio_mode_grouper_common[] = {    GPIO_INIT_PIN_MODE(TEGRA_GPIO_PDD7, false, 0),    GPIO_INIT_PIN_MODE(TEGRA_GPIO_PCC6, false, 0),    GPIO_INIT_PIN_MODE(TEGRA_GPIO_PR0, false, 0),     \/\/ \u0432\u043e\u0442 \u0442\u0443\u0442 \u043d\u0430\u0448\u0438 \u043f\u0438\u043d\u044b. \u041f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a - \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0438\u0436\u0435 :)    GPIO_INIT_PIN_MODE(TEGRA_GPIO_PBB0, true, 0),    GPIO_INIT_PIN_MODE(TEGRA_GPIO_PBB5, false, 0), };  \/\/  static __initdata struct tegra_pingroup_config grouper_pinmux_common[] = {  \/\/ ...  \/* \u041d\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u043c \u0440\u0430\u043d\u0435\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u0438\u043d\u043e\u0432 \u043d\u0430 \u0441\u0445\u0435\u043c\u0435 \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438, \u0447\u0442\u043e \u0438\u0441\u043a\u043e\u043c\u044b\u0435 \u043f\u0438\u043d\u044b \u0438\u043c\u0435\u044e\u0442 \u0438\u043c\u0435\u043d\u0430 GPIO_PBB0 \u0438 GPIO_PBB5. O\u043d\u0438 \u0437\u0434\u0435\u0441\u044c, \u0432 \u0431\u043b\u043e\u043a\u0435 \u0434\u043b\u044f \u043a\u0430\u043c\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0442. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0445 \u043a\u043e\u043d\u0444\u0438\u0433 *\/ \/* CAMERA *\/ DEFAULT_PINMUX(CAM_MCLK,        VI_ALT2,         PULL_DOWN, NORMAL,     INPUT), DEFAULT_PINMUX(GPIO_PCC1,       RSVD1,           NORMAL,    NORMAL,     INPUT), \/\/ \u0431\u044b\u043b\u043e \/\/DEFAULT_PINMUX(GPIO_PBB0,       RSVD1,           NORMAL,    NORMAL,     INPUT),    \/\/ \u0441\u0442\u0430\u043b\u043e: \u043f\u0438\u043d \u0434\u043b\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u0432\u0445\u043e\u0434 \u0438 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u043c \u0432\u0432\u0435\u0440\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 nIRQ DEFAULT_PINMUX(GPIO_PBB0,       RSVD1,           PULL_UP,    NORMAL,     INPUT), DEFAULT_PINMUX(GPIO_PBB3,       VGP3,            NORMAL,    NORMAL,     INPUT), \/\/DEFAULT_PINMUX(GPIO_PBB5,       VGP5,            NORMAL,    NORMAL,     INPUT),   \/\/ \u0431\u044b\u043b\u043e \/\/ \u0441\u0442\u0430\u043b\u043e: \u043f\u0438\u043d \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u0435\u043c \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0438 \u043f\u0440\u0438\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u043c \u0432\u043d\u0438\u0437, \u0447\u0442\u043e\u0431\u044b \u0441\u0435\u043d\u0441\u043e\u0440 \u0431\u044b\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e DEFAULT_PINMUX(GPIO_PBB5,       VGP5,            PULL_DOWN,    NORMAL,     OUTPUT),  \/\/ ...  };  \/\/ ...  \/\/ \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \/\/ \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0442\u043e \u0432\u044b\u0448\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0432\u044b\u0440\u0435\u0437\u043a\u0435 \u043a\u043e\u0434\u0430 static void __init grouper_gpio_init_configure(void) {    int len;    int i;    struct gpio_init_pin_info *pins_info;    u32 project_info = grouper_get_project_id();     if (project_info == GROUPER_PROJECT_NAKASI_3G) {       len = ARRAY_SIZE(init_gpio_mode_grouper3g);       pins_info = init_gpio_mode_grouper3g;    } else {       \/\/ \u0432\u043e\u0442 \u044d\u0442\u043e \u043e\u043d\u043e - \u043f\u0440\u043e\u0435\u043a\u0442 \u0443 \u043d\u0430\u0441 \u043d\u0435 3g, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0435 \u044d\u0442\u043e\u043c 3G \u043d\u0435\u0442\u0443       len = ARRAY_SIZE(init_gpio_mode_grouper_common);       pins_info = init_gpio_mode_grouper_common;    }     for (i = 0; i &lt; len; ++i) {       tegra_gpio_init_configure(pins_info-&gt;gpio_nr,          pins_info-&gt;is_input, pins_info-&gt;value);       pins_info++;    } }  \/\/ \u042d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0434\u0440\u0430, \u0433\u0434\u0435 \u043d\u0430\u0448\u0438 pinmux`\u044b \u0443\u0439\u0434\u0443\u0442 \u0432 \u0437\u0430\u043a\u0440\u044b\u0442\u0443\u044e \u0447\u0430\u0441\u0442\u044c \/\/ \u043a\u043e\u0434\u0430 nVidia int __init grouper_pinmux_init(void) {    struct board_info board_info;    u32 project_info = grouper_get_project_id();     tegra_get_board_info(&board_info);    BUG_ON(board_info.board_id != BOARD_E1565);    grouper_gpio_init_configure();     \/\/ \u0432\u043e\u0442 \u0442\u0443\u0442    tegra_pinmux_config_table(grouper_pinmux_common, ARRAY_SIZE(grouper_pinmux_common));    tegra_drive_pinmux_config_table(grouper_drive_pinmux,                ARRAY_SIZE(grouper_drive_pinmux));     if (project_info == GROUPER_PROJECT_NAKASI_3G) {       tegra_pinmux_config_table(pinmux_grouper3g,             ARRAY_SIZE(pinmux_grouper3g));    }     tegra_pinmux_config_table(unused_pins_lowpower,       ARRAY_SIZE(unused_pins_lowpower));    grouper_pinmux_audio_init();     return 0; }  \/\/ ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0424\u0430\u0439\u043b board-grouper-sensors.c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0432\u0441\u044f\u043a\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043d\u0438\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u0435\u043c). \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u044f\u0434\u0440\u0430. \u041a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">board-grouper-sensors.c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/ ...  \/\/ \u0412\u043e\u0442 \u044d\u0442\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0436\u0435 \/\/ \u0438\u043c\u0435\u0442\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430 GPIO \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 nIRQ \/\/ \u041f\u043e \u0447\u0435\u0441\u0442\u043d\u043e\u043a\u0443, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0434\u043e \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435  \/\/ \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u043b\u0435\u043d\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f  \/\/ \u0447\u0430\u0441\u0442\u044c\u044e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u043d\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 GPIO \u0434\u043b\u044f PWRD static const struct i2c_board_info tricky_sensor_board_info[] = {    {       I2C_BOARD_INFO(&quot;tricky&quot;,0x55),       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PBB0)    }, };  \/\/ \u0432\u043e\u0442 \u0442\u0443\u0442 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c 2 \u043d\u0430\u0448\u0438\u0445 GPIO (\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0434\u043b\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u0430). \/\/ \u0425\u0417 \u043a\u0430\u043a \u0442\u0430\u043c\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0432 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \/\/ \u0441\u043a\u0430\u0436\u0435\u043c \u043a\u0430\u043a\u0438\u043c\u0438 \u0445\u043e\u0442\u0438\u043c \u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430\u0448\u0438 \u043f\u0438\u043d\u044b \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u043c \u0438 \u0443\u0436\u0435 \/\/ \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0447\u0435\u0440\u0435\u0437 linux\/gpio \u043f\u0443\u0442\u0451\u043c static int grouper_tricky_init(void) {    \/\/ \u0445\u043e\u0442\u044f \u0438 \u0442\u0443\u0442 \u043d\u0435 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u0435\u0437 \u043c\u0430\u0433\u0438\u0438 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 tegra_gpio_enable,    \/\/ \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043d\u0430\u0447\u0435 \u043f\u0438\u043d\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443\u0442     int ret = 0;     ret = gpio_request(TEGRA_GPIO_PBB5, &quot;tricky_npwd&quot;);    if (ret &lt; 0) {      pr_err(&quot;Tricky: Error: cannot register GPIO_PWR_DOWN\\n&quot;);    }    else {       ret = gpio_direction_output(TEGRA_GPIO_PBB5, true);       if (ret &lt; 0) {         pr_err(&quot;Tricky: Error: cannot set GPIO_PWR_DOWN as output\\n&quot;);       }        else {          tegra_gpio_enable(TEGRA_GPIO_PBB5);       }    }     ret = gpio_request(TEGRA_GPIO_PBB0, &quot;tricky_nirq&quot;);    if (ret &lt; 0) {       pr_err(&quot;Tricky: Error: cannot register GPIO_NIRQ\\n&quot;);       return ret;    }     ret = gpio_direction_input(TEGRA_GPIO_PBB0);    if (ret &lt; 0) {       gpio_free(TEGRA_GPIO_PBB0);       pr_err(&quot;Tricky: Error: cannot set GPIO_NIRQ as input\\n&quot;);    }    else {       tegra_gpio_enable(TEGRA_GPIO_PBB0);    }     printk(&quot;%s: Tricky OK&quot;, __FUNCTION__);     return ret; }  \/\/ ...  \/\/ \u0410 \u0432\u043e\u0442 \u044d\u0442\u043e \u0443\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0430, \/\/ \u0433\u0434\u0435 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0432\u043e\u0438\u0445 \u043f\u0438\u043d\u043e\u0432 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e int __init grouper_sensors_init(void) {    int err;    grouper_camera_init();  #ifdef CONFIG_VIDEO_OV2710    i2c_register_board_info(2, grouper_i2c2_board_info,     ARRAY_SIZE(grouper_i2c2_board_info)); #endif    \/* Front Camera mi1040 + *\/    pr_info(&quot;mi1040 i2c_register_board_info&quot;);    i2c_register_board_info(2, front_sensor_i2c2_board_info,     ARRAY_SIZE(front_sensor_i2c2_board_info));     err = grouper_nct1008_init();    if (err)       printk(&quot;[Error] Thermal: Configure GPIO_PCC2 as an irq fail!&quot;);    i2c_register_board_info(4, grouper_i2c4_nct1008_board_info,       ARRAY_SIZE(grouper_i2c4_nct1008_board_info));     mpuirq_init();     i2c_register_board_info(2, cardhu_i2c1_board_info_al3010,       ARRAY_SIZE(cardhu_i2c1_board_info_al3010));      if (GROUPER_PROJECT_BACH == grouper_get_project_id()) {         i2c_register_board_info(2, cap1106_i2c1_board_info,                 ARRAY_SIZE(cap1106_i2c1_board_info));     }     \/\/ \u0432\u043e\u0442 \u0442\u0443\u0442 \u043d\u0430\u0448\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f    grouper_tricky_init();     i2c_register_board_info(2\/*\u044d\u0442\u043e \u043d\u043e\u043c\u0435\u0440 I2C \u0448\u0438\u043d\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0438\u0434\u0438\u0442 \u0441\u0435\u043d\u0441\u043e\u0440*\/, tricky_sensor_board_info,       ARRAY_SIZE(tricky_sensor_board_info));     return 0; }  \/\/ TBD (\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0447\u0430\u0441\u0442\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;linux\/init.h&gt;           \/\/ Macros used to mark up functions e.g. __init __exit #include &lt;linux\/module.h&gt;         \/\/ Core header for loading LKMs into the kernel #include &lt;linux\/device.h&gt;         \/\/ Header to support the kernel Driver Model #include &lt;linux\/kernel.h&gt;         \/\/ Contains types, macros, functions for the kernel #include &lt;linux\/fs.h&gt;             \/\/ Header for the Linux file system support #include &lt;linux\/i2c.h&gt;            \/\/ main sensor communication protocol #include &lt;linux\/gpio.h&gt;           \/\/ sensor`s wake\/sleep and new data interrupts are processed via two pins #include &lt;linux\/interrupt.h&gt;      \/\/ Support GPIO IRQ handler #include &lt;asm\/uaccess.h&gt;          \/\/ copy_to_user and copy_from_user functions #include &lt;asm\/io.h&gt;               \/\/ Access to memset() #include &lt;linux\/workqueue.h&gt;      \/\/ Make IRQ event into deferred handler task #include &lt;linux\/mutex.h&gt;          \/\/ Sync data buffer usage between IRQ-work and outer read requests #include &lt;linux\/delay.h&gt;          \/\/ Access to mdelay  \/\/ \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0432 \u044f\u0434\u0440\u0435 \u043a\u0430\u043a \/dev\/tricky_temperature #define  DEVICE_NAME &quot;tricky_temperature&quot; \/\/ \u0418\u043c\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 #define  CLASS_NAME  &quot;tricky&quot;  \/\/ ... \u0432\u0441\u044f\u043a\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0434\u0435\u0444\u0430\u0439\u043d\u044b ...  \/\/ \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f MODULE_LICENSE(&quot;GPL&quot;); MODULE_AUTHOR(&quot;Pavel Akimov&quot;); MODULE_DESCRIPTION(&quot;Test Linux driver for tricky sensor&quot;);  \/\/\/&lt; \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 modinfo MODULE_VERSION(&quot;0.1&quot;);  \/\/ \u043d\u043e\u043c\u0435\u0440 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 static int    majorNumber; static struct class*  trickyClass  = NULL; static struct device* trickyDevice = NULL;  \/\/ ... \u0432\u0441\u044f\u043a\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0441\u0435\u043d\u0441\u043e\u0440\u0430 ...  \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445  static u8 sensor_data_buffer[I2C_DATA_SIZE] = { 0 };  \/\/ \u0427\u0435\u0440\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 I2C \u043a\u043b\u0438\u0435\u043d\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 struct i2c_client *tricky_i2c_client = NULL;  \/\/ \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 static int dev_open(struct inode *, struct file *); static ssize_t dev_read(struct file *, char *, size_t, loff_t *); static ssize_t dev_ioctl(struct file *file, unsigned int ioctl_num, unsigned long ioctl_param);  \/\/ \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 I2C \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 static int tricky_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id); static int tricky_i2c_remove(struct i2c_client *i2c_client);  \/\/ \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0438\u043d static int set_sensor_power(u8 enabled); \/\/ \u0427\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 I2C static int read_raw_temperatures(void); \/\/ \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043e \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 static irq_handler_t tricky_data_irq_handler(unsigned int irq, void *dev_id, struct pt_regs *regs); \/\/ \u041f\u043e\u0442\u043e\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f static void read_data_work_handler(struct work_struct *w);  \/\/ \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u043e\u043d\u043e\u0432\u044b\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u044f\u0434\u0440\u0435 static struct workqueue_struct *wq = NULL; static DECLARE_DELAYED_WORK(read_data_work, read_data_work_handler); static struct mutex read_data_mutex;  \/\/ \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 static struct file_operations fops = {    .open = dev_open,    .read = dev_read,    .unlocked_ioctl = dev_ioctl };  \/\/ \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432  static const struct i2c_device_id tricky_i2c_id[] = {    { CLASS_NAME, 0 },    { }, \/\/ \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0434\u0440\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u043a\u043e\u043d\u0435\u0446 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b }; MODULE_DEVICE_TABLE(i2c, tricky_i2c_id);  \/\/ \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f static struct i2c_driver tricky_i2c_driver = {    .driver = {       .owner = THIS_MODULE,       .name = CLASS_NAME,    },        .id_table = tricky_i2c_id,    .probe = tricky_i2c_probe,    .remove = tricky_i2c_remove };  \/\/ \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f i2c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 i2c \u043a\u043b\u0438\u0435\u043d\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0436\u0435\u043b\u0435\u0437\u0430 static int tricky_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) {    tricky_i2c_client = client;    return 0; }  \/\/  static int tricky_i2c_remove(struct i2c_client *i2c_client) {    if (tricky_i2c_client != NULL) {       i2c_unregister_device(tricky_i2c_client);       tricky_i2c_client = NULL;    }     return 0; }  \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u044f\u0434\u0440\u0430 static int __init tricky_temperature_init(void) {    int err;     \/\/ Try to dynamically allocate a major number for the device -- more difficult but worth it    majorNumber = register_chrdev(0, DEVICE_NAME, &fops);    if (majorNumber&lt;0){       pr_err(KERN_ALERT &quot;Tricky failed to register a major number\\n&quot;);       return majorNumber;    }    printk(KERN_INFO &quot;Tricky: registered correctly with major number %d\\n&quot;, majorNumber);      \/\/ Register the device class    trickyClass = class_create(THIS_MODULE, CLASS_NAME);    if (IS_ERR(trickyClass)){                \/\/ Check for error and clean up if there is       pr_err(KERN_ALERT &quot;Failed to register device class\\n&quot;);       err = PTR_ERR(trickyClass);          \/\/ Correct way to return an error on a pointer       goto err_char_dev;    }    printk(KERN_INFO &quot;Tricky: device class registered correctly\\n&quot;);      \/\/ Register the device driver    trickyDevice = device_create(trickyClass, NULL, MKDEV(majorNumber, 0), NULL, DEVICE_NAME);    if (IS_ERR(trickyDevice)){               \/\/ Clean up if there is an error       pr_err(KERN_ALERT &quot;Failed to create the device\\n&quot;);       err = PTR_ERR(trickyDevice);       goto err_class;    }    printk(KERN_INFO &quot;Tricky: device class created correctly\\n&quot;); \/\/ Made it! device was initialized     \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 I2\u0421 \u0434\u0440\u0430\u0439\u0432\u0435\u0440, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435     \/\/ \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 (\u0442\u043e\u0442, \u0447\u0442\u043e \u0432 board grouper sensors) \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u043c probe    err = i2c_add_driver(&tricky_i2c_driver);    if (err &lt; 0) {       pr_err(&quot;Tricky: Error: %s: driver registration failed, error=%d\\n&quot;, __func__, err);       goto err_dev;    }     \/\/ \u0412\u0441\u044f\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u043d\u0441\u043e\u0440 \u043f\u043e I2C ...     \/\/ \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 IRQ \u043a \u043d\u0430\u0448\u0435\u043c\u0443 callback`\u0443 \u0441 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0439 \u043c\u0435\u0442\u043a\u043e\u0439    \/\/ \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u0440\u0435\u0430\u043a\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043d\u0430 \u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0444\u0440\u043e\u043d\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u0430    err = request_irq(       i2c_client-&gt;irq,       (irq_handler_t)tricky_data_irq_handler,       IRQF_TRIGGER_FALLING,       &quot;tricky_gpio_handler&quot;,       NULL); \/\/ no shared interrupt lines    if (err &lt; 0) {       pr_err(&quot;Tricky: Error: %s: cannot register GPIO_NIRQ irq handler: Error=%d\\n&quot;, __func__, err);       goto err_drv;    }     \/\/ \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u043f\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0443 IRQ    wq = create_singlethread_workqueue(&quot;tricky_work&quot;);    mutex_init(&read_data_mutex);     printk(KERN_INFO &quot;Tricky: initialization completed\\n&quot;);    return 0;  err_irq:    destroy_workqueue(wq);    free_irq(i2c_client-&gt;irq, NULL); err_drv:    i2c_del_driver(&tricky_i2c_driver); err_dev:    device_destroy(trickyClass, MKDEV(majorNumber, 0));     \/\/ remove the device    class_unregister(trickyClass);                          \/\/ unregister the device class err_class:    class_destroy(trickyClass);                             \/\/ remove the device class err_char_dev:    unregister_chrdev(majorNumber, DEVICE_NAME);             \/\/ unregister the major number     return err; }  \/\/ \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 static void __exit tricky_temperature_exit(void) {     if (delayed_work_pending(&read_data_work) != 0)       cancel_delayed_work_sync(&read_data_work);    destroy_workqueue(wq);     free_irq(i2c_client-&gt;irq, NULL);    i2c_del_driver(&tricky_i2c_driver);     if (tricky_i2c_client != NULL) {       i2c_unregister_device(tricky_i2c_client);       tricky_i2c_client = NULL;    }     device_destroy(trickyClass, MKDEV(majorNumber, 0));    class_unregister(trickyClass);    class_destroy(trickyClass);    unregister_chrdev(majorNumber, DEVICE_NAME);     printk(KERN_INFO &quot;Tricky: Goodbye\\n&quot;); }  static int dev_open(     struct inode *node,      struct file *filep) {        printk(KERN_INFO &quot;Tricky: Open the LKM!\\n&quot;);    return 0; }  static ssize_t dev_read(     struct file *filep,      char *buffer,      size_t len,      loff_t *offset) {     int ret;     \/\/ \u0434\u0430, \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u044b\u0448\u0435 (HAL) \u0437\u043d\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0431\u0430\u0439\u0442    if (!buffer || len != I2C_DATA_SIZE) {       return -EINVAL;    }     mutex_lock(&read_data_mutex);    ret = copy_to_user(buffer, sensor_data_buffer, I2C_DATA_SIZE);    mutex_unlock(&read_data_mutex);     if (ret != 0) {       return -ENOMEM;    }     return 0; }  static ssize_t dev_ioctl(     struct file *file,     unsigned int ioctl_num,     unsigned long ioctl_param) {         switch (ioctl_num) {         case IOCTL_POWER:             ret = set_sensor_power(ioctl_param != CMD_POWER_WAKEUP ? 1 : 0);             if (ret &lt; 0) {                 return ret;             }             break;          case ... \/\/ more commands                  default:             pr_err(KERN_INFO &quot;Tricky: invalid command type to apply\\n&quot;);             return -EINVAL;     }      return 0; }  static int set_sensor_power(u8 enabled) {    gpio_set_value(GPIO_PWR_DOWN, enabled != 0);    return 0; }  \/\/ \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 I2C \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0432\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f: \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 (2 \u0431\u0430\u0439\u0442\u0430)  \/\/ \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 static int read_raw_temperatures(void) {    int ret;    struct i2c_msg write_message;    struct i2c_msg read_message;     write_message.addr = I2C_SLAVE_ADDRESS;    write_message.flags = 0; \/\/ plain write    write_message.buf = (char*)i2c_read_temperatures_address;    write_message.len = sizeof(i2c_read_temperatures_address);     memset(sensor_data_buffer, 0, sizeof(sensor_data_buffer));    read_message.addr = I2C_SLAVE_ADDRESS;    read_message.flags = I2C_M_RD; \/\/ plain read    read_message.buf = (char*)sensor_data_buffer;    read_message.len = sizeof(sensor_data_buffer);     \/\/ read out data    ret = i2c_transfer(tricky_i2c_client-&gt;adapter, &write_message, 1);    if (ret &lt; 0) {       pr_err(KERN_INFO &quot;Tricky: Cannot write data address. Error=%d\\n&quot;, ret);       return ret;    }     ret = i2c_transfer(tricky_i2c_client-&gt;adapter, &read_message, 1);    if (ret &lt; 0) {       pr_err(KERN_INFO &quot;Tricky: Cannot read data from the sensor. Error=%d\\n&quot;, ret);       return ret;    }     return 0; }  \/\/ \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0445\u043e\u0440\u043e\u0448\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \/\/ \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 I2C \u0442\u0430\u043c \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u0432\u043e\u043e\u0431\u0449\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \/\/ I2C \u0441\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \/\/ \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u0430, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0433\u043e\u0442\u043e\u0432\u044b, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \/\/ \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 static irq_handler_t tricky_data_irq_handler(unsigned int irq, void *dev_id, struct pt_regs *regs) {    \/\/ \u0437\u0430\u043e\u0434\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c    if (delayed_work_pending(&read_data_work) == 0)       queue_delayed_work(wq, &read_data_work, msecs_to_jiffies(1));     return (irq_handler_t)IRQ_HANDLED; }  \/\/ \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \/\/ \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \/\/ \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (\u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e) static void read_data_work_handler(struct work_struct *w) {    int ret;     mutex_lock(&read_data_mutex);    ret = read_raw_temperatures();    mutex_unlock(&read_data_mutex);     if (ret &lt; 0) {       printk(KERN_INFO &quot;Tricky: read_data_work_handler. Ret = %d\\n&quot;, ret);    } }   \/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 module_init(tricky_temperature_init); module_exit(tricky_temperature_exit); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0434\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438: KConfig \u0438 Makefile.<\/p>\n<p>  \u0412 KConfig \u0434\u043e\u043f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0430\u0431\u0437\u0430\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 TRICKY_SENSOR (\u0431\u0435\u0437 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 CONFIG_), \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 Makefile, \u0443\u0447\u0442\u0451\u0442 \u0435\u0433\u043e \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435. \u0422\u0430\u043a\u0436\u0435, \u043d\u0430\u0448 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u0438\u0434\u0435\u043d \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 make menuconfig.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">KConfig<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>menuconfig THERMAL    tristate &quot;Generic Thermal sysfs driver&quot;    help      Generic Thermal Sysfs driver offers a generic mechanism for      thermal management. Usually it's made up of one or more thermal      zone and cooling device.      Each thermal zone contains its own temperature, trip points,      cooling devices.      All platforms with ACPI thermal support can use this driver.      If you want this support, you should say Y or M here.  config THERMAL_HWMON    bool    depends on THERMAL    depends on HWMON=y || HWMON=THERMAL    default y  config TRICKY_SENSOR    default y    bool    prompt &quot;Tricky temperature sensor support&quot; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Makefile<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>obj-$(CONFIG_THERMAL)      += thermal_sys.o obj-$(CONFIG_TRICKY_SENSOR)  += tricky_temperature.o  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u044f\u0434\u0440\u0430:<\/p>\n<pre><code>kernel\/tegra\/arch\/arm\/mach-tegra\/board-grouper-pinmux.c kernel\/tegra\/arch\/arm\/mach-tegra\/board-grouper-sensors.c kernel\/tegra\/drivers\/thermal\/tricky_sensor.c kernel\/tegra\/drivers\/thermal\/KConfig kernel\/tegra\/drivers\/thermal\/Makefile <\/code><\/pre>\n<p>  <b>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u0441\u0432\u043e\u0435\u0439 \u0436\u0435\u043b\u0435\u0437\u043a\u0438 \u0432 Android middleware \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e<\/b><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u044b\u0448\u0435. \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 user space \u0447\u0430\u0441\u0442\u044c Android, \u0433\u0434\u0435 \u043d\u0430\u0434\u043e \u043a\u0430\u043a-\u0442\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u043a \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u043c\u043d\u043e\u0433\u0438\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u043e\u0439 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 \u0432 Android \u0435\u0441\u0442\u044c \u0441\u043b\u043e\u0439 middleware (\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0421\/\u0421++), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0436\u0435\u043b\u0435\u0437\u043d\u044b\u0445 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439 (Hardware Abstraction Level \u2014 HAL). \u0418 \u0434\u043b\u044f \u0432\u0441\u044f\u043a\u0438\u0445 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0445 \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u044b\u0445 \u0438 \u0442.\u043f. \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u043c\u0435\u0441\u0442\u043e. \u041d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e HAL \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0435\u0433\u043e API \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u2014 \u0447\u0442\u043e \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u0432\u0432\u0438\u0434\u0443 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c. \u0418 \u0435\u0441\u043b\u0438 \u043e\u0434\u043d\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u0434 \u0441\u0435\u0431\u044f, \u0442\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043e\u0439. \u0412\u0441\u0451 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/source.android.com\/devices\/sensors\/sensor-stack.html\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u0418 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432 \u0447\u0430\u0441\u0442\u0438 read-only \u0440\u0435\u0436\u0438\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u043d\u0441\u043e\u0440\u0430\u043c\u0438 \u0432\u043e\u0442 \u044d\u0442\u0430 \u0446\u0438\u0442\u0430\u0442\u0430 \u0438\u0437 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432\u044b\u0448\u0435:<\/p>\n<blockquote><p>Besides sampling frequency and maximum reporting latency, applications cannot configure sensor parameters. For example, imagine a physical sensor that can function both in \u201chigh accuracy\u201d and \u201clow power\u201d modes. Only one of those two modes can be used on an Android device, because otherwise, an application could request the high accuracy mode, and another one a low power mode; there would be no way for the framework to satisfy both applications. The framework must always be able to satisfy all its clients, so this is not an option.<\/p>\n<p>  There is no mechanism to send data down from the applications to the sensors or their drivers. This ensures one application cannot modify the behavior of the sensors, breaking other applications. <\/p><\/blockquote>\n<p>  \u0410 \u043d\u0430\u043c \u043d\u0443 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c (\u043f\u0438\u0442\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438 \u0440\u0435\u0436\u0438\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440) \u0438 \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448 \u0441\u0435\u043d\u0441\u043e\u0440 \u043d\u0435\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0448\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0442\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 HAL. \u0412\u043e\u0442 <a href=\"https:\/\/source.android.com\/devices\/index.html#Hardware%20Abstraction%20Layer\">\u0442\u0443\u0442<\/a> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u0442\u0430\u043a \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0437\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0436\u0435\u043b\u0435\u0437\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0435\u043c\u0443 ID \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e hw_device_t \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044f, \u043d\u0443 \u0438 \u043d\u0430\u0448\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. Google \u043d\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u043d\u0430 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0437 \u043e\u0433\u043b\u044f\u0434\u043a\u0438 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0431\u0440\u0430\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441\u0435\u044f\u0442\u044c \u0434\u043e\u0431\u0440\u043e\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">sensor_tricky_temperature.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#ifndef ANDROID_TRICKY_INTERFACE_H #define ANDROID_TRICKY_INTERFACE_H  #include &lt;stdint.h&gt; #include &lt;sys\/cdefs.h&gt; #include &lt;sys\/types.h&gt;  #include &lt;hardware\/hardware.h&gt;  __BEGIN_DECLS  #define TRICKY_HARDWARE_MODULE_ID &quot;tricky&quot;  struct tricky_device_t {     struct hw_device_t common;      int (*read_sample)(unsigned short *psynchro, short *pobj_temp, short *pntc1_temp, short *pntc2_temp, short *pntc3_temp);     int (*activate)(unsigned char enabled);     int (*set_mode)(unsigned char is_continuous); };  __END_DECLS  #endif \/\/ ANDROID_TRICKY_INTERFACE_H <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">sensor_tricky_temperature.c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;errno.h&gt; #include &lt;cutils\/log.h&gt; #include &lt;cutils\/sockets.h&gt; #include &lt;sys\/types.h&gt; #include &lt;sys\/stat.h&gt; #include &lt;fcntl.h&gt; #include &lt;linux\/i2c.h&gt; #include &lt;hardware\/sensor_tricky_temperature.h&gt;  #define     LOG_TAG  &quot;TRICKY&quot; #define     DEVICE_NAME &quot;\/dev\/tricky_temperature&quot;  #define     TRICKY_MODE_0  0 #define     TRICKY_MODE_1  1  int fd = 0;  int read_sample(unsigned short *psynchro, short *pobj_temp, short *pntc1_temp, short *pntc2_temp, short *pntc3_temp) {     int ret = 0;     unsigned char buffer[10];          ALOGD(&quot;HAL -- read_sample() called&quot;);      ret = read(fd, (char*)buffer, sizeof(buffer));         if (ret &lt; 0) {         ALOGE(&quot;HAL -- cannot read raw temperature data&quot;);         return -1;     }      if (psynchro)   *psynchro   = (unsigned short)(buffer[3] &lt;&lt; 8 | buffer[2]);     if (pobj_temp)  *pobj_temp  = (short)(buffer[1] &lt;&lt; 8 | buffer[0]);     if (pntc1_temp) *pntc1_temp = (short)(buffer[5] &lt;&lt; 8 | buffer[4]);     if (pntc2_temp) *pntc2_temp = (short)(buffer[7] &lt;&lt; 8 | buffer[6]);     if (pntc3_temp) *pntc3_temp = (short)(buffer[9] &lt;&lt; 8 | buffer[8]);      ALOGD(&quot;HAL - sample read OK&quot;);     return 0; }  int activate(unsigned char enabled) {     int ret = 0;     ALOGD(&quot;HAL - activate(%d) called&quot;, enabled);      ret = ioctl(fd, 0, enabled ? TRICKY_MODE_0 : TRICKY_MODE_1);     if (ret &lt; 0) {         ALOGE(&quot;HAL - cannot write activation state&quot;);         return -1;     }      ALOGD(&quot;HAL - activation state written OK&quot;);     return 0; }  int set_mode(unsigned char is_continuous) {     int ret;     ALOGD(&quot;HAL -- set_mode(%d) called&quot;, is_continuous);      ret = ioctl(fd, 1, is_continuous ? TRICKY_MODE_0 : TRICKY_MODE_1);     if (ret &lt; 0) {         ALOGE(&quot;HAL - cannot write mode state&quot;);         return -1;     }      ALOGD(&quot;HAL - mode state written OK&quot;);     return 0; }  static int open_tricky(const struct hw_module_t* module, char const* name, struct hw_device_t** device) {     int ret = 0;      struct tricky_device_t *dev = malloc(sizeof(struct tricky_device_t));     if (dev == NULL) {         ALOGE(&quot;HAL - cannot allocate memory for the device&quot;);         return -ENOMEM;     }     else {         memset(dev, 0, sizeof(*dev));     }      ALOGD(&quot;HAL - openHAL() called&quot;);      dev-&gt;common.tag = HARDWARE_DEVICE_TAG;     dev-&gt;common.version = 0;     dev-&gt;common.module = (struct hw_module_t*)module;     dev-&gt;read_sample = read_sample;     dev-&gt;activate = activate;     dev-&gt;set_mode = set_mode;      *device = (struct hw_device_t*) dev;      fd = open(DEVICE_NAME, O_RDWR);     if (fd &lt;= 0) {         ALOGE(&quot;HAL - cannot open device driver&quot;);         return -1;     }      ALOGD(&quot;HAL - has been initialized&quot;);     return 0; }  static struct hw_module_methods_t tricky_module_methods = {     .open = open_tricky };  struct hw_module_t HAL_MODULE_INFO_SYM = {     .tag = HARDWARE_MODULE_TAG,     .version_major = 1,     .version_minor = 0,     .id = TRICKY_HARDWARE_MODULE_ID,     .name = &quot;Tricky HAL Module&quot;,     .author = &quot;Pavel Akimov&quot;,     .methods = &tricky_module_methods, }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <a href=\"https:\/\/developer.android.com\/ndk\/guides\/android_mk.html\">Android.mk<\/a> \u0444\u0430\u0439\u043b, \u0433\u0434\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0430\u043a\u043e\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Android.mk<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code># \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 LOCAL_PATH := $(call my-dir)  # \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043e\u0434\u043d\u0430 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u043c .mk \u0444\u0430\u0439\u043b\u0435, \u0442\u0430\u043a \u0447\u0442\u043e # \u043d\u0430\u0434\u043e \u043e\u0447\u0438\u0449\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c # \u0414\u0430, LOCAL_PATH \u043d\u0435 \u0443\u0431\u044c\u0451\u0442\u0441\u044f include $(CLEAR_VARS)  LOCAL_PRELINK_MODULE := false # \u044d\u0442\u043e \u0442\u043e, \u0433\u0434\u0435 \u0435\u043c\u0443 \u043b\u0435\u0436\u0430\u0442\u044c \u0432 \u0437\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)\/hw # \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware # \u0432\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438 LOCAL_SRC_FILES := sensor_tricky_temperature.c # \u0438\u043c\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 LOCAL_MODULE := techartmsjdts.default LOCAL_MODULE_TAGS := debug  include $(BUILD_SHARED_LIBRARY) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d Android.mk \u0444\u0430\u0439\u043b \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0432\u044b\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 libhardware. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e \u0438\u043c\u0435\u043d\u0438 ID \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Android.mk<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>hardware_modules := gralloc hwcomposer audio nfc nfc-nci local_time \\    power usbaudio audio_remote_submix camera consumerir tricky include $(call all-named-subdir-makefiles,$(hardware_modules))  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 HAL \u0438\u043c\u0435\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b<\/p>\n<pre><code>hardware\/libhardware\/include\/hardware\/sensor_tricky_temperature.h hardware\/libhardware\/modules\/Android.mk hardware\/libhardware\/modules\/tricky\/sensor_tricky_temperature.c hardware\/libhardware\/modules\/tricky\/Android.mk <\/code><\/pre>\n<p>  <b>\u041a\u0430\u043a \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u043a\u0443\u0434\u0430 \u0447\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u0438 \u043d\u0430\u0448\u0451\u043b\u0441\u044f<\/b><\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u0434\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448 HAL \u043a\u0442\u043e-\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u043b. \u0412 \u0434\u0440\u0443\u0433\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 OC \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0449\u0438 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0438\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430 Java. \u0414\u0430\u0431\u044b \u043d\u0435 \u0432\u044b\u0431\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0440\u044f\u0434\u0430, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d. \u0421\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u0448 \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0430\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0444\u0430\u0439\u043b\u0430\u0445:<\/p>\n<pre><code>frameworks\\base\\core\\java\\android\\app\\ContextImpl.java frameworks\\base\\core\\java\\android\\content\\Context.java frameworks\\base\\core\\java\\android\\hardware\\temperature\\ITrickyService.aidl frameworks\\base\\core\\java\\android\\hardware\\temperature\\TrickyTemperatureData.aidl frameworks\\base\\core\\java\\android\\hardware\\temperature\\TrickyTemperatureData.java frameworks\\base\\core\\java\\android\\hardware\\temperature\\TrickyManager.java frameworks\\base\\services\\java\\com\\android\\server\\temperature\\TrickyService.java frameworks\\base\\services\\java\\com\\android\\server\\SystemServer.java frameworks\\base\\services\\jni\\Android.mk frameworks\\base\\services\\jni\\com_android_server_temperature_TrickyService.cpp frameworks\\base\\services\\jni\\onload.cpp frameworks\\base\\Android.mk <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0443\u0440\u043e\u0432\u043d\u0435\u043c native \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a HAL \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0443\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 JNI. \u0417\u0430\u043e\u0434\u043d\u043e \u0437\u0430\u043f\u0438\u043b\u0438\u043c \u0441\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0439 \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/developer.android.com\/guide\/components\/aidl.html\">AIDL<\/a>, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u0438\u0437 C++ \u0432 Java.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 native \u0447\u0430\u0441\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/ \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f LOG_TAG \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043b\u043e\u0433\u0435 \u0431\u0443\u0434\u0443\u0442 \u0442\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0430\u0434\u043e #define LOG_TAG &quot;TRICKY&quot;  #include &quot;jni.h&quot; #include &quot;JNIHelp.h&quot; #include &quot;android_runtime\/AndroidRuntime.h&quot;  #include &lt;utils\/misc.h&gt; #include &lt;utils\/Log.h&gt; #include &lt;hardware\/hardware.h&gt; #include &lt;hardware\/sensor_tricky_temperature.h&gt;  #include &lt;stdio.h&gt;  \/\/ \u0434\u0430, \u0432\u0441\u0451 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \/\/ \u043c\u044b \u043d\u0435 \u0430\u0431\u044b \u043a\u0442\u043e, \u0430 \u0447\u0430\u0441\u0442\u044c Android namespace android {     static jlong init_native(JNIEnv *env, jobject clazz)     {         int err;         hw_module_t* module;         tricky_device_t* dev = NULL;                  \/\/ \u043d\u0430\u0439\u0434\u0435\u043c \u043d\u0430\u0448 HAL         \/\/ \u0442\u0430\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0442\u0435\u0439, \u0433\u0434\u0435 hw \u043c\u043e\u0434\u0443\u043b\u0438 \u043c\u043e\u0433\u0443\u0442         \/\/ \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u043d \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0433\u043e         \/\/ HAL \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 &quot;.default&quot; - \u0445\u043e\u0442\u044f \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0447\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0443\u0444\u0444\u0438\u043a\u0441 (\u0447\u0435\u0441\u0442\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b         \/\/ \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e \u044d\u0442\u043e \u0436\u0435\u043b\u0435\u0437\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 HAL, \u043d\u043e \u0434\u0430 \u043b\u0430\u0434\u043d\u043e)         err = hw_get_module(TRICKY_HARDWARE_MODULE_ID, (hw_module_t const**)&module);         if (err == 0) {             err = module-&gt;methods-&gt;open(module, &quot;&quot;, ((hw_device_t**) &dev));             if (err != 0) {                 ALOGE(&quot;init_native: cannot open device module: %d&quot;, err);                 return -1;             }         } else {             ALOGE(&quot;init_native: cannot get device module: %d&quot;, err);             return 0;         }          ALOGD(&quot;init_native: start ok&quot;);          \/\/ \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0432 Java \u0447\u0430\u0441\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b         return (jlong)dev;     }      \/\/ \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0432\u0435\u0442     static void finalize_native(JNIEnv *env, jobject clazz, jlong ptr)     {         tricky_device_t* dev = (tricky_device_t*)ptr;          if (dev == NULL) {             ALOGE(&quot;finalize_native: invalid device pointer&quot;);             return;         }          free(dev);         ALOGD(&quot;finalize_native: finalized ok&quot;);     }      \/\/ \u0442\u0443\u0442 \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 HAL     \/\/  \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0438\u0445 \u0438\u0437 C++ \u0432 \u043d\u0430\u0448\u0435\u043c \u0442\u0438\u043f\u0435 TrickyTemperatureData     static jobject read_sample_native(JNIEnv *env, jobject clazz, jlong ptr)     {         tricky_device_t* dev = (tricky_device_t*)ptr;         int ret = 0;          unsigned short synchro = 0;         short obj_temp = 0;         short ntc1_temp = 0;         short ntc2_temp = 0;         short ntc3_temp = 0;          if (dev == NULL) {             ALOGE(&quot;read_sample_native: invalid device pointer&quot;);             return (jobject)NULL;         }          ret = dev-&gt;read_sample(&synchro, &obj_temp, &ntc1_temp, &ntc2_temp, &ntc3_temp);         if (ret &lt; 0) {             ALOGE(&quot;read_sample_native: Cannot read TrickyTemperatureData&quot;);             return (jobject)NULL;         }          \/\/ \u0438\u0449\u0435\u043c \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043a\u0430\u043a         \/\/ android.hardware.temperature.TrickyTemperatureData         jclass c = env-&gt;FindClass(&quot;android\/hardware\/temperature\/TrickyTemperatureData&quot;);         if (c == 0) {             ALOGE(&quot;read_sample_native: Find Class TrickyTemperatureData Failed&quot;);             return (jobject)NULL;         }          \/\/ \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 (\u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432)         jmethodID cnstrctr = env-&gt;GetMethodID(c, &quot;&lt;init&gt;&quot;, &quot;()V&quot;);         if (cnstrctr == 0) {             ALOGE(&quot;read_sample_native: Find constructor TrickyTemperatureData Failed&quot;);             return (jobject)NULL;         }          \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c ID \u043f\u043e\u043b\u0435\u0439. \u0414\u0430, \u043f\u043e\u043b\u0435\u0439, \u0434\u043e\u043b\u0433\u043e \u0443\u0436\u0435 \u043f\u0438\u0448\u0443, \u043d\u0435\u0442 \u0441\u0438\u043b \u043d\u0430 getter`\u044b \u0438 setter`\u044b         jfieldID synchroField = env-&gt;GetFieldID(c, &quot;synchro&quot;, &quot;I&quot;);         jfieldID objTempField = env-&gt;GetFieldID(c, &quot;objectTemperature&quot;, &quot;I&quot;);         jfieldID ntc1TempField = env-&gt;GetFieldID(c, &quot;ntc1Temperature&quot;, &quot;I&quot;);         jfieldID ntc2TempField = env-&gt;GetFieldID(c, &quot;ntc2Temperature&quot;, &quot;I&quot;);         jfieldID ntc3TempField = env-&gt;GetFieldID(c, &quot;ntc3Temperature&quot;, &quot;I&quot;);         if (synchroField == 0 || objTempField == 0 ||             ntc1TempField == 0 || ntc2TempField == 0 || ntc3TempField == 0) {             ALOGE(&quot;read_sample_native: cannot get fields of resulting object&quot;);             return (jobject)NULL;         }          \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438         jobject jdtsData = env-&gt;NewObject(c, cnstrctr);          env-&gt;SetIntField(jdtsData, synchroField, (jint)synchro);         env-&gt;SetIntField(jdtsData, objTempField, (jint)obj_temp);         env-&gt;SetIntField(jdtsData, ntc1TempField, (jint)ntc1_temp);         env-&gt;SetIntField(jdtsData, ntc2TempField, (jint)ntc2_temp);         env-&gt;SetIntField(jdtsData, ntc3TempField, (jint)ntc3_temp);          ALOGD(&quot;read_sample_native: read ok&quot;);         return jdtsData;     }      \/\/ \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u043f\u0438\u0441\u0430\u043d\u0438\u043d\u044b         \/\/ \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0438\u0445 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 JNI    static JNINativeMethod method_table[] = {         { &quot;init_native&quot;, &quot;()J&quot;, (void*)init_native },         { &quot;finalize_native&quot;, &quot;(J)V&quot;, (void*)finalize_native },         { &quot;read_sample_native&quot;, &quot;(J)Landroid\/hardware\/temperature\/TrickyTemperatureData;&quot;, (void*)read_sample_native },         { &quot;activate_native&quot;, &quot;(JZ)Z&quot;, (void*)activate_native },         { &quot;set_mode_native&quot;, &quot;(JZ)Z&quot;, (void*)set_mode_native},     };      \/\/ \u0418 \u0432\u043e\u0442 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u0437 onload.cpp,      \/\/ \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 system server \u0441\u043b\u0443\u0436\u0431\u044b     int register_android_server_JdtsService(JNIEnv *env)     {         ALOGD(&quot;register_android_server_JdtsService&quot;);          return jniRegisterNativeMethods(             env,              &quot;com\/android\/server\/temperature\/JdtsService&quot;,             method_table,             NELEM(method_table));     }; }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432 onload.cpp \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 JNI \u0447\u0430\u0441\u0442\u0438 \u0442\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044d\u0442\u043e \u043d\u0430\u0434\u043e. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435, \u0438 \u043d\u0430\u0448.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">onload.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/ ...  #include &quot;JNIHelp.h&quot; #include &quot;jni.h&quot; #include &quot;utils\/Log.h&quot; #include &quot;utils\/misc.h&quot;  namespace android {  \/\/ ...  int register_android_server_JdtsService(JNIEnv* env); };  using namespace android;  extern &quot;C&quot; jint JNI_OnLoad(JavaVM* vm, void* \/* reserved *\/) {     JNIEnv* env = NULL;     jint result = -1;      if (vm-&gt;GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {         ALOGE(&quot;GetEnv failed!&quot;);         return result;     }     ALOG_ASSERT(env, &quot;Could not retrieve the env!&quot;);      \/\/ ...      register_android_server_JdtsService(env);      return JNI_VERSION_1_4; }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 Android.mk \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0441\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439, \u0438 \u043d\u0430\u0448 JNI \u043a\u0443\u0441\u043e\u043a \u0442\u043e\u0436\u0435 \u0442\u0430\u043c.<\/p>\n<p>  \u041d\u0430\u0448 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AIDL, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Android, \u0434\u0430 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0435\u043c. \u0422\u0430\u043a \u0436\u0435, \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0442\u044c \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c Parcelable, \u0447\u0442\u043e \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 \u0434\u0430\u043b\u044c\u0448\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">TrickyTemperatureData.aidl<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>package android.hardware.temperature;  parcelable TrickyTemperatureData; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">TrickyTemperatureData.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package android.hardware.temperature;  import android.os.Parcel; import android.os.Parcelable;  \/** {@hide} *\/ public final class TrickyTemperatureData implements Parcelable {    public int synchro;     public int objectTemperature;     public int ntc1Temperature;     public int ntc2Temperature;     public int ntc3Temperature;      public static final Parcelable.Creator&lt;TrickyTemperatureData&gt; CREATOR = new Parcelable.Creator&lt;TrickyTemperatureData&gt;() {         public TrickyTemperatureData createFromParcel(Parcel in) {             return new TrickyTemperatureData(in);         }          public TrickyTemperatureData[] newArray(int size) {             return new TrickyTemperatureData[size];         }     };      public TrickyTemperatureData() {     }      private TrickyTemperatureData(Parcel in) {         readFromParcel(in);     }      @Override     public void writeToParcel(Parcel out, int flags) {         out.writeInt(synchro);         out.writeInt(objectTemperature);         out.writeInt(ntc1Temperature);         out.writeInt(ntc2Temperature);         out.writeInt(ntc3Temperature);     }      public void readFromParcel(Parcel in) {         synchro = in.readInt();         objectTemperature = in.readInt();         ntc1Temperature = in.readInt();         ntc2Temperature = in.readInt();         ntc3Temperature = in.readInt();     }      @Override     public int describeContents() {         return 0;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u0430\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0435\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u044b \u0438 \u043d\u0435\u0437\u0430\u0442\u0435\u0439\u043b\u0438\u0432\u044b, \u043d\u0435 \u0431\u0443\u0434\u0443 \u0438\u0445 \u0442\u0443\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c, \u043f\u043e\u0442\u043e\u043c \u0432 \u0441\u0441\u044b\u043b\u043a\u0430\u0445 \u0431\u0443\u0434\u0451\u0442 \u0432\u0441\u0451, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u043b\u0438 \u043f\u043e\u0442\u044b\u043a\u0430\u0442\u044c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 context.getSytemService. \u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0442\u043e\u044f\u0442\u044c \u043f\u043e\u043c\u0435\u0442\u043a\u0430 <a href=\"https:\/\/habrahabr.ru\/users\/hide\/\" class=\"user_link\">hide<\/a>, \u0438\u043d\u0430\u0447\u0435 \u0441\u0431\u043e\u0440\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442, \u0432\u044b\u0439\u0434\u044f \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u0430 \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0432 API, \u043b\u0438\u0431\u043e \u0437\u0430\u043d\u044b\u043a\u0430\u0442\u044c.<\/p>\n<pre><code class=\"java\">\/\/ frameworks\\base\\core\\java\\android\\content\\Context.java  \/**   * @hide   *\/  public static final String TRICKY_SERVICE = &quot;android.service.tricky.ITrickyService&quot;; <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 ServiceManager \u0447\u0435\u0440\u0435\u0437 SystemServer \u0432\u043e\u0442 \u0442\u0443\u0442.<\/p>\n<pre><code class=\"java\">\/\/ frameworks\\base\\services\\java\\com\\android\\server\\SystemServer.java  \/\/ initAndLoop ...  try {    Slog.e(TAG, &quot;Tricky Service&quot;);    trickyService = new TrickyService(context);    ServiceManager.addService(Context.TRICKY_SERVICE, trickyService); } catch (Throwable e) {    Slog.e(TAG, &quot;Failure starting TrickyService&quot;, e); } <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0435\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 context (\u0432 \u0431\u043b\u043e\u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438).<\/p>\n<pre><code class=\"java\">\/\/frameworks\\base\\core\\java\\android\\app\\ContextImpl.java  registerService(TRICKY_SERVICE, new ServiceFetcher() {    public Object createService(ContextImpl ctx) {        IBinder iBinder = ServiceManager.getService(Context.TRICKY_SERVICE);        return new TrickyManager(ITrickyService.Stub.asInterface(iBinder));    }}); <\/code><\/pre>\n<p>  \u0421\u0430\u043c registerService \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 Android 4.4.4 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">private static int sNextPerContextServiceCacheIndex = 0; \/\/ \u0442.\u0435. \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c fetcher \u0441 \u0441\u0435\u0432\u0438\u0441\u043e\u043c \u0432 \u043e\u0431\u0449\u0438\u0439 map private static void registerService(String serviceName, ServiceFetcher fetcher) {    if (!(fetcher instanceof StaticServiceFetcher)) {       fetcher.mContextCacheIndex = sNextPerContextServiceCacheIndex++;    }    SYSTEM_SERVICE_MAP.put(serviceName, fetcher); }  \/\/ \u0414\u0430\u043b\u0435\u0435, \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f getSystemService \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0449\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \/\/ ...   @Override  public Object getSystemService(String name) {      ServiceFetcher fetcher = SYSTEM_SERVICE_MAP.get(name);      return fetcher == null ? null : fetcher.getService(this);  }  <\/code><\/pre>\n<p>  <b>\u041a\u0430\u043a \u043f\u0440\u043e\u0440\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 SEAndroid\/SELinux \u0434\u043e\u043f\u0438\u0441\u0430\u0432 \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430<\/b><\/p>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u0432\u0440\u043e\u0434\u0435 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0431\u0435\u0437\u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e root, \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f, \u0438\u0437\u0432\u0435\u0440\u0433\u0430\u044f \u0432 \u043b\u043e\u0433\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043f\u0440\u0430\u0432 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a, \u0430 \u043f\u043e\u0442\u043e\u043c \u0438 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u044c \u0447\u0435\u0433\u043e-\u043b\u0438\u0431\u043e \u0438, \u0432 \u0438\u0442\u043e\u0433\u0435, \u043f\u0440\u043e\u0444\u0438\u0442\u0430 \u043d\u0435\u0442. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0447\u0430\u0441\u0442\u0438 sepolicy.<\/p>\n<p>  \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 init, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0441\u0430\u043c\u044b\u0439 \u0440\u0430\u043d\u043d\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<pre><code>#(device\/asus\/grouper\/init.grouper.rc)  # ...  on post-fs-data        # ...     # tricky temperature sensor    # \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043c \u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f system    # \u0442\u0430\u043a \u043a\u0430\u043a \u0441 root`\u043e\u043c \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c    chmod 0660 \/sys\/class\/tricky\/tricky_temperature\/dev    chown system system \/sys\/class\/tricky\/tricky_temperature\/dev  <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0430\u0432\u0430 \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 ueventd.<\/p>\n<pre><code># device\/asus\/grouper\/ueventd.grouper.rc  \/dev\/tricky_temperature 0660 system system <\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442 \u0434\u0430\u043b\u044c\u0448\u0435\u2026 \u043d\u0430\u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u044f\u043a\u0438\u0445 SELinux \u043f\u0440\u0430\u0432\u0438\u043b, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u0433 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c (\u043a\u0443\u0434\u0430 \u043c\u044b \u0435\u0433\u043e \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0438\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0448 \u0434\u0440\u0430\u0439\u0432\u0435\u0440. \u042f \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u043b\u0441\u044f, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0438\u0437 <a href=\"https:\/\/android.googlesource.com\/device\/generic\/brillo\/+\/master\/sepolicy\">Brillo<\/a>. \u041d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u044f \u043f\u0440\u043e\u043d\u0438\u043a\u0441\u044f \u0438 \u043f\u043e\u043d\u044f\u043b \u0432\u0441\u0451, \u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0440\u0442\u044f\u043d\u043a\u043e\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>#####################################  # \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d, \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 # \u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0438 \u0441\u0432\u044f\u0437\u0435 \u043a\u043e\u0433\u043e \u043b\u0438\u0431\u043e \u0441 \u043a\u0435\u043c \u043b\u0438\u0431\u043e.  # \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0438\u0448\u0435\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u044d\u0442\u043e\u0442 \u043d\u0430\u0448 \u0434\u043e\u043c\u0435\u043d.   # (te_macros) # tricky_service_domain(domain)  # Allow a base set of permissions common across Android daemons. define(`tricky_service_domain', ` init_daemon_domain($1)  # Allow using binder and performing IPC to system services. binder_use($1) binder_service($1)  # Allow access to files in \/proc. # Fixes denials like: # avc: denied { read } for pid=1267 comm=&quot;peripheralman&quot; name=&quot;misc&quot; dev=&quot;proc&quot; #   ino=4026531967 scontext=u:r:peripheralman:s0 #   tcontext=u:object_r:proc:s0 tclass=file permissive=0 allow $1 proc:file r_file_perms;  allow $1 tricky_service:service_manager find;  # Cut down on spam. dontaudit $1 kernel:system module_request; ')  ##################################### # \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u044d\u0442\u043e\u0442 \u0434\u043e\u043c\u0435\u043d \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0434\u043b\u044f \u043d\u0435\u0433\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043d\u0435 \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b\u0438\u043a,  # \u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 # (tricky_service.te)  type tricky_service, domain; type tricky_service_exec, exec_type, file_type;  tricky_service_domain(tricky_service)  ##################################### # \u0423\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a system manager # (service.te)  type tricky_service, service_manager_type;  # \u0414\u0430\u043b\u0435\u0435 \u0443\u0436\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043d\u0430 \u043a\u0430\u043a\u043e\u0435 \u0438\u043c\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0448 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u0442\u0438\u043f  # &quot;tricky_service&quot; \u0438 \u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430. # \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0435 SELinux \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0443\u0442 https:\/\/source.android.com\/security\/selinux\/  ##################################### # (service_contexts)  android.service.jdtstemperature.IJdstsService   u:object_r:tricky_service:s0  ##################################### # \u0421 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0432\u0441\u0451. \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438 \u0447\u0442\u043e \u0434\u043e \u043d\u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c\u0441\u044f # \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0438\u043f \u0434\u043b\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 # (device.te)  type tricky_device, dev_type, mlstrustedobject;  ##################################### # \u0421\u0432\u044f\u0436\u0435\u043c \u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u0441 \u0444\u0430\u0439\u043b\u043e\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 # (file_contexts)  \/dev\/tricky_temperature    u:object_r:tricky_device:s0  ##################################### # \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 (\u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u043a\u0430\u043a \u044f \u043f\u043e\u043d\u044f\u043b,  # \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0441\u0442\u0430\u0440\u0442\u0443\u044e\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u0435 &quot;bootanim&quot; \u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043f\u0440\u0430\u0432 \u043d\u0430  # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432) #(bootanim.te)  allow bootanim tricky_device:chr_file rw_file_perms;  ##################################### # \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0443\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d \u0434\u043b\u044f SystemServer \u0438 system apps  # (system_server.te)  allow system_server tricky_device:chr_file rw_file_perms;  ##################################### # (system_app.te)  allow system_app tricky_device:chr_file rw_file_perms; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u043c\u0435\u043d \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043d\u0430\u0448\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430. \u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435, \u0430 \u0432 adb shell \u0441\u0442\u0430\u043b\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f system \u0438 \u043e\u0442\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u043c\u0438\u0440\u0430.<\/p>\n<p>  <b>\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u2014 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043f\u043f<\/b><\/p>\n<p>  \u041d\u0430\u0434\u043e \u0431\u044b \u0435\u0449\u0435 \u043a\u0430\u043a-\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u043e \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0438 \u0447\u0435\u0440\u0435\u0437 adb shell \u043f\u044f\u043b\u0438\u0442\u044c\u0441\u044f \u0432 logcat, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435 \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0440\u0430\u0434\u044b \u0442\u0430\u043a\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e OC \u0435\u0449\u0435 \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435. \u041a\u043e\u043c\u0443 \u043e\u043d\u043e \u043d\u0443\u0436\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0430. \u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 packages\/apps\/TrickyDemo, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 build\/target\/product\/core.mk \u0443\u043a\u0430\u0436\u0435\u043c \u0435\u0433\u043e \u0441 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 internal application<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.android.trickydemo;  import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.Switch; import android.widget.TextView;  import android.hardware.temperature.*;  public class MainActivity extends Activity {      private final String TAG = &quot;TrickyDemo&quot;;      private final int POLLING_PERIOD_MS = 200;      private TrickyManager mServiceManager = null;     private TrickyTemperatureData mSensorData = null;      private GaugeView mGaugeObj;     private GaugeView mGaugeNtc1;     private GaugeView mGaugeNtc2;     private GaugeView mGaugeNtc3;     private TextView mTextSynchro;     private ImageView mIrqImage;      private TextView mTextObj;     private TextView mTextNtc1;     private TextView mTextNtc2;     private TextView mTextNtc3;      \/\/ all temperatures are .2 points precision values in degrees Celsius     final private Object mDataSync = new Object();     private boolean mMeasModeUpdateRequired;     \/\/ set up when user switches between measurement modes and queues I2C expander command     \/\/ to switch the mode     private boolean mIsContinuousMode;     \/\/ continuous mode (power is always on, no control)     \/\/ burst mode (every cycle power on, read and power off required)      private boolean mPowerState;     private boolean mPowerUpdateRequired;      private Thread mCommThread = null;     private boolean mIsRunning = true; \/\/ the communication thread goes on unless onDestroy method is called              @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);          \/\/ enforce the sensor to switch into continuous mode on startup         mPowerUpdateRequired = true;         mPowerState = true;         mMeasModeUpdateRequired = true;         mIsContinuousMode = true;          mIrqImage = (ImageView) findViewById(R.id.image_led_irq);          mGaugeObj = (GaugeView) findViewById(R.id.gauge_view_obj);         mGaugeNtc1 = (GaugeView) findViewById(R.id.gauge_view_ntc1);         mGaugeNtc2 = (GaugeView) findViewById(R.id.gauge_view_ntc2);         mGaugeNtc3 = (GaugeView) findViewById(R.id.gauge_view_ntc3);         mTextSynchro = (TextView) findViewById(R.id.text_synchro);          mTextObj = (TextView) findViewById(R.id.text_obj);         mTextNtc1 = (TextView) findViewById(R.id.text_ntc1);         mTextNtc2 = (TextView) findViewById(R.id.text_ntc2);         mTextNtc3 = (TextView) findViewById(R.id.text_ntc3);          Switch switch_mode = (Switch) findViewById(R.id.switch1);         switch_mode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {             @Override             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {                 synchronized (mDataSync) {                     mIsContinuousMode = isChecked;                     mMeasModeUpdateRequired = true;                 }             }         });          Switch switch_power = (Switch) findViewById(R.id.switch_power);         switch_power.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {             @Override             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {                 synchronized (mDataSync) {                     mPowerState = isChecked;                     mPowerUpdateRequired = true;                 }             }         });         switch_power.setChecked(true); \/\/ power is on by default          mServiceManager = (TrickyManager) getSystemService(TRICKY_SERVICE);          mCommThread = new Thread() {             @Override             public void run() {                 while(mIsRunning) {                      synchronized (mDataSync) {                         if (mPowerUpdateRequired) {                             if (mServiceManager.activate(mPowerState)) {                                 mPowerUpdateRequired = false;                             } else {                                 Log.w(TAG, &quot;Cannot update power state&quot;);                             }                         }                          if (mMeasModeUpdateRequired) {                             if (mServiceManager.setMode(mIsContinuousMode)) {                                 mMeasModeUpdateRequired = false;                             } else {                                 Log.w(TAG, &quot;Cannot update measurement mode&quot;);                             }                         }                     }                      mSensorData = mServiceManager.readSample();                     if (mSensorData != null) {                         updateUI();                     } else {                         updateNonIRQUI();                     }                      try {                         Thread.sleep(POLLING_PERIOD_MS);                     } catch (InterruptedException e) {                         e.printStackTrace();                     }                 }             }         };          mCommThread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {             @Override             public void uncaughtException(Thread t, Throwable e) {                 e.printStackTrace();             }         });         mCommThread.start();     }      @Override     protected void onDestroy() {         super.onDestroy();          try {             mCommThread.join(POLLING_PERIOD_MS * 2);         } catch (InterruptedException e) {             e.printStackTrace();         }     }      private void updateUI() {         runOnUiThread(new Runnable() {             public void run() {                 float obj_temp = mSensorData.objectTemperature \/ 100.F;                 float ntc1_temp = mSensorData.ntc1Temperature \/ 100.F;                 float ntc2_temp = mSensorData.ntc2Temperature \/ 100.F;                 float ntc3_temp = mSensorData.ntc3Temperature \/ 100.F;                  String s_obj = String.format(&quot;%.2f \u00b0C&quot;, obj_temp);                 String s_ntc1 = String.format(&quot;%.2f \u00b0C&quot;, ntc1_temp);                 String s_ntc2 = String.format(&quot;%.2f \u00b0C&quot;, ntc2_temp);                 String s_ntc3 = String.format(&quot;%.2f \u00b0C&quot;, ntc3_temp);                 String s_synchro = String.format(&quot;Synchro = %d&quot;, mSensorData.synchro);                  mGaugeObj.setTargetValue(obj_temp);                 mTextObj.setText(s_obj);                  mGaugeNtc1.setTargetValue(ntc1_temp);                 mTextNtc1.setText(s_ntc1);                  mGaugeNtc2.setTargetValue(ntc2_temp);                 mTextNtc2.setText(s_ntc2);                  mGaugeNtc3.setTargetValue(ntc3_temp);                 mTextNtc3.setText(s_ntc3);                  mTextSynchro.setText(s_synchro);                  mIrqImage.setImageDrawable(getResources().getDrawable(R.drawable.led_green_hi));                  Log.d(TAG,                      s_synchro                     + &quot;Obj = &quot; + s_obj                      + &quot; NTC1 = &quot; + s_ntc1                      + &quot; NTC2 = &quot; + s_ntc2                      + &quot; NTC3 = &quot; + s_ntc3);             }         });     }      private void updateNonIRQUI() {         runOnUiThread(new Runnable() {             public void run() {                 mIrqImage.setImageDrawable(getResources().getDrawable(R.drawable.led_green_md));             }         });     } }<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0434\u0443\u0448\u0435\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 Android Studio (\u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c sdk \u2014 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u0434 4.4.4), \u0430 \u0434\u0430\u043b\u0435\u0435 \u043e\u0442\u043e\u0440\u0432\u0430\u043d\u043e \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435. \u0410 \u0432\u043e\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u043d\u043e\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Android.mk, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443 \u043c\u0435\u043d\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a.<\/p>\n<pre><code>LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS)  LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := $(call all-java-files-under, src) LOCAL_RESOURCE_FILES := $(addprefix $(LOCAL_PATH)\/, res) LOCAL_PACKAGE_NAME := TrickyDemo LOCAL_CERTIFICATE := platform LOCAL_STATIC_JAVA_LIBRARIES := android-support-core-utils-api24  include $(BUILD_PACKAGE)<\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438\u043b\u0438 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0438\u0437 \u043d\u0438\u0445, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 out\/target\/common\/obj\/SHARED_LIBRARIES \u0438 \u0438\u0449\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438\u043c\u0435\u043d\u0430.<\/p>\n<p>  <b>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0451 \u0441\u043e\u0431\u0440\u0430\u0442\u044c<\/b><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c. \u0418\u0442\u0430\u043a, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u0438\u0435:<\/p>\n<p>  HW: Nexus 7 (2012 grouper)<br \/>  OS: Android Kitkat 4.4.4 KTU84P<br \/>  Kernel: tegra3_android_defconfig 3.1.10-gle42d16<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u044f\u0434\u0440\u043e.<br \/>  \u041d\u0443\u0436\u043d\u044b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u044f\u0434\u0440\u0430 \u0442\u0443\u0442:<\/p>\n<pre><code>git clone https:\/\/android.googlesource.com\/kernel\/tegra.git -b android-tegra3-grouper-3.1-kitkat-mr2<\/code><\/pre>\n<p>  \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u044f\u0434\u0440\u0430 \u043e\u0442\u0441\u044e\u0434\u0430:<\/p>\n<pre><code>mkdir arm-eabi-4.6 cd arm-eabi-4.6 git init git clone https:\/\/android.googlesource.com\/platform\/prebuilts\/gcc\/linux-x86\/arm\/arm-eabi-4.6\/<\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u044f\u0434\u0440\u043e (\u043d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u044f\u0434\u0440\u0430):<\/p>\n<pre><code>ARCH=arm SUBARCH=arm CROSS_COMPILE=&lt;path_to_arm_eabi-4.6&gt;\/arm-eabi-4.6\/bin\/arm-eabi- make tegra3_android_defconfig ARCH=arm SUBARCH=arm CROSS_COMPILE=&lt;path_to_arm_eabi-4.6&gt;\/arm-eabi-4.6\/bin\/arm-eabi- make menuconfig ARCH=arm SUBARCH=arm CROSS_COMPILE=&lt;path_to_arm_eabi-4.6&gt;\/arm-eabi-4.6\/bin\/arm-eabi- make -j4 zImage<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 make menuconfig \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 device drivers \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f Tricky temperature sensor (\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e menuconfig \u2014 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0448\u0435). \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u044f\u0434\u0440\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u041f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043b\u0435\u0436\u0438\u0442 \u0432 kernel\/tegra\/arch\/arm\/boot\/zImage.<\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 Android. \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 Android OS \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043d\u0430\u0434\u043e \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0433\u0443\u0447\u0438\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0441\u043a\u0443\u0447\u0430\u0442\u044c \u043d\u0430\u0434\u043e\u043b\u0433\u043e, \u0438 \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 (<a href=\"http:\/\/source.android.com\/source\/requirements.html#hardware-requirements\">\u0432\u043e\u0442 \u0442\u0443\u0442<\/a> \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e). \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b\u0430 \u043d\u0430 Ubuntu 14.04 LTS x64 (\u0441\u0431\u043e\u0440\u043a\u0430 \u043d\u0430 Windows \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e).<\/p>\n<p>  \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d <a href=\"http:\/\/source.android.com\/source\/initializing.html\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430 \u043d\u0451\u043c \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0441\u044c. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u041e\u0421 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Java (\u0434\u043b\u044f Android 7 \u044d\u0442\u043e OpenJDK Java 8, \u0434\u043b\u044f Nexus 7 \u0438 Android 4.x \u044d\u0442\u043e Oracle Java 6).<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u0431\u043e\u0440\u043a\u043e\u0439 Android \u0447\u0438\u0442\u0430\u0435\u043c \u0432\u043e\u0442 <a href=\"http:\/\/source.android.com\/source\/requirements.html\">\u044d\u0442\u043e<\/a>.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/gerrit.googlesource.com\/git-repo\/\">Repo<\/a> \u2014 \u043d\u0430\u0445\u043b\u043e\u0431\u0443\u0447\u043a\u0430 \u043d\u0430\u0434 Git, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c git-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 <a href=\"https:\/\/source.android.com\/source\/downloading\">\u0442\u0443\u0442<\/a>). \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Repo \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0431\u0443\u0434\u0443\u0449\u0438\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u044d\u0442\u043e:<\/p>\n<pre><code>repo init -u https:\/\/android.googlesource.com\/platform\/manifest -b android-4.4.4_r2 cd .repo repo sync<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0433\u0438\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u043a\u0430\u0447\u0430\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043a\u043e\u043b\u043e 50\u0413\u0431.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0438 \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f (\u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0430\u043f\u043a\u0438 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 Android OS) \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 4.4.4 KTU84P \u0432 \u043d\u0430\u0448\u0435\u043c Nexus`\u0435:<\/p>\n<pre><code>https:\/\/dl.google.com\/dl\/android\/aosp\/asus-grouper-ktu84p-b12ce5f7.tgz https:\/\/dl.google.com\/dl\/android\/aosp\/broadcom-grouper-ktu84p-646d5a68.tgz https:\/\/dl.google.com\/dl\/android\/aosp\/elan-grouper-ktu84p-742223b3.tgz https:\/\/dl.google.com\/dl\/android\/aosp\/invensense-grouper-ktu84p-724c855a.tgz https:\/\/dl.google.com\/dl\/android\/aosp\/nvidia-grouper-ktu84p-e6d581dc.tgz https:\/\/dl.google.com\/dl\/android\/aosp\/nxp-grouper-ktu84p-27abae08.tgz https:\/\/dl.google.com\/dl\/android\/aosp\/widevine-grouper-ktu84p-57b01f77.tgz<\/code><\/pre>\n<p>  \u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432:<\/p>\n<pre><code>tar -xvf asus-grouper-ktu84p-b12ce5f7.tgz  tar -xvf broadcom-grouper-ktu84p-646d5a68.tgz  tar -xvf elan-grouper-ktu84p-742223b3.tgz  tar -xvf invensense-grouper-ktu84p-724c855a.tgz  tar -xvf nvidia-grouper-ktu84p-e6d581dc.tgz  tar -xvf nxp-grouper-ktu84p-27abae08.tgz  tar -xvf widevine-grouper-ktu84p-57b01f77.tgz  rm *.tgz .\/extract-asus-grouper.sh  .\/extract-broadcom-grouper.sh  .\/extract-elan-grouper.sh  .\/extract-invensense-grouper.sh  .\/extract-nvidia-grouper.sh  .\/extract-nxp-grouper.sh  .\/extract-widevine-grouper.sh<\/code><\/pre>\n<p>  \u041d\u0443 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c:<\/p>\n<pre><code>mkdir nexus cd nexus make clobber (\u043e\u0447\u0438\u0441\u0442\u0438\u0442 \u0432\u0441\u0451 \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0434\u043e \u044d\u0442\u043e\u0433\u043e) . build\/envsetup.sh lunch aosp_grouper-userdebug make -j4<\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>make clobber<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 out\/target\/product\/grouper (system.img, recovery.img, ramdisk.img, userdata.img). Apk-\u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 out\/target\/product\/grouper\/obj\/APPS\/Jdts160demo_intermediates\/package.apk.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043b\u0438\u0432\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430 \u0447\u0435\u0440\u0435\u0437 fastboot. \u0421\u043e\u0437\u0434\u0430\u0435\u043c .zip-\u0430\u0440\u0445\u0438\u0432 \u0441 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043b\u0438\u0442\u044c \u0432\u043e FLASH \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e boot.img, system.img, recovery.img, userdata.img, ramdisk.img), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0444\u0430\u0439\u043b\u043e\u043c android-info.txt \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code>require board=grouper require version-bootloader=4.23<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u0441\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0442\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 Factory image \u043e\u0431\u0440\u0430\u0437 <a href=\"https:\/\/dl.google.com\/dl\/android\/aosp\/nakasi-ktu84p-factory-9482e892.zip\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 flash_all.sh \u0438\u0437 \u043d\u0435\u0433\u043e. \u0415\u0433\u043e \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u0441\u0432\u043e\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f boot.img \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0443\u043b\u0437\u0443 abootimg:<\/p>\n<pre><code>sudo apt-get install abootimg abootimg --create boot.img -k zImage -r ramdisk.img<\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0434\u043b\u044f abootimg \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0432 \u0442.\u0447. \u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u043d\u043e \u043e\u043d\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0445\u0440\u0435\u043d \u043d\u0430 \u043d\u0435\u0451.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0435\u0436\u0438\u043c fastboot. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<blockquote><p> adb reboot bootloader (\u0435\u0441\u043b\u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043f\u043e usb \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d adb)<br \/>   \u0435\u0441\u043b\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d, \u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0438 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c.<\/p><\/blockquote>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c fastboot (usb \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0438 usb debugging \u0432\u043a\u043b\u044e\u0447\u0435\u043d).<\/p>\n<pre><code>fastboot devices<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434. \u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0432\u0441\u0451, \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<pre><code>fastboot oem unlock fastboot erase boot fastboot erase cache fastboot erase recovery fastboot erase system fastboot erase userdata fastboot -2 update image.zip<\/code><\/pre>\n<p>  <b>\u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0443\u043d\u043a\u0442\u0430\u0445 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a<\/b><\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0438 \u0447\u0435\u0441\u0442\u043d\u043e \u0438 \u043f\u0443\u0442\u044c \u0431\u044b\u043b \u043f\u0440\u043e\u0439\u0434\u0435\u043d \u043f\u043e \u043a\u0430\u043c\u0443\u0448\u043a\u0430\u043c, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0441\u0435\u0442\u0438. \u0423\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u0437\u0430\u043a\u0440\u044b\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437 \u0438 \u0434\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0438 \u043a\u0430\u043a \u0438 \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0430\u0447\u0435. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a:<\/p>\n<ul>\n<li>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u041e\u0421 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 devices\/asus\/grouper\/&#8230;, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 overlays, \u0430 \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u044f\u0434\u0440\u0430 \u0438 \u041e\u0421, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0447\u0442\u0435\u043d\u044b \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435. \u042f \u0442\u0430\u043a \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438 \u043d\u0435 \u0432\u044b\u0441\u043d\u0438\u043b, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0442\u0430\u043c \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0442\u0443 \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0447\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445, \u0438\u043b\u0438 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f.\n<\/li>\n<li>\u041a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 audio-jack \u0442\u0430\u043a \u0438 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u043d\u0430 <a href=\"http:\/\/www.pabr.org\/consolejack\/consolejack.en.html#\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0440\u043e\u043d\u0438\u043b\u0430 \u044f\u0434\u0440\u043e \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043d\u0435 \u0442\u0430\u043a. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e:\n<ul>\n<li>\u041d\u0430 \u0441\u0445\u0435\u043c\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f uart-1 &#038; uart-4 \u0434\u043b\u044f debug, \u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 pinmux \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 GPIO \u0431\u044b\u043b\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 not_used\/disabled.<\/li>\n<li>Google \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 usb-uart FTDI \u0434\u043b\u044f \u043f\u043e\u0434\u0430\u0447\u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0430 \u043a\u0430\u043d\u0430\u043b \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0442\u043e\u043a\u0443 50\u043c\u0410, \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/li>\n<li>\u0412 make menuconfig \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c uart \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 uart`\u043e\u0432. \u041c\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438, \u043d\u043e \u043d\u0435 \u0432 \u043a\u0443\u043f\u0435 \u0441 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0443\u043d\u043a\u0442\u0430\u043c\u0438.<\/li>\n<li>\u0415\u0449\u0435 \u0431\u044b\u043b\u0438 fastboot \u0438 bootloader \u043e\u043f\u0446\u0438\u0438 \u0438 command line \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041c\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043d\u0435 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b.<\/li>\n<\/ul>\n<p>  <\/li>\n<li>\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c system<\/li>\n<\/ul>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/326640\/\"> https:\/\/habrahabr.ru\/post\/326640\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/5cc\/51f\/5c5\/5cc51f5c5f144d08bd8e7d5afb2254f6.png\" \/><\/div>\n<p>  \u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0441\u0438\u0434\u0435\u043b\u0438 \u0438 \u043f\u0438\u0441\u0430\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043d\u044b\u0439 \u0441\u0435\u043d\u0441\u043e\u0440 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0430\u043c\u0438. \u0418 \u0432\u0434\u0440\u0443\u0433 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0441\u0435\u043d\u0441\u043e\u0440 \u0445\u043e\u0447\u0435\u0442 \u0441\u0435\u0431\u0435 \u043e\u0434\u0438\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u0422\u0430\u043a \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c I2C\/GPIO \u0441\u0435\u043d\u0441\u043e\u0440 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Android OS, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0435\u043d\u0441\u043e\u0440 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0438\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0430\u043c\u043e\u0433\u043e \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/p>\n<p>  \u0411\u0443\u0434\u0443\u0447\u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u043c \u0441\u0443\u0431\u043f\u043e\u0434\u0440\u044f\u0434\u043e\u043c, \u043d\u0430\u0434\u0435\u0436\u0434\u044b \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043e\u0442\u043a\u043b\u0438\u043a \u043e\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e, \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u0448\u043a\u0430\u0445 \u0438 \u0437\u0430\u0441\u0443\u043d\u0443\u0442\u044c \u043d\u0430\u0448\u0443 \u0436\u0435\u043b\u0435\u0437\u044f\u043a\u0443 \u0432 \u043a\u0430\u043a\u043e\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441 Android.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-285062","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/285062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=285062"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/285062\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=285062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=285062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=285062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}