• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

delphiAndroidshellRaspberryGPIO

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

https://community.idera.com/developer-tools/platforms/f/android-platform/72286/how-to-execute-android-shell-commands-from-delphi
I installed Emteria OS in my Raspberry and I can access GPIO of Raspberry with shell commands .

I want to execute these shell commands (or any other shell command) from my Delphi app.

I am new in Android an i cannot find related info .

Is there any example or related link ?

Here is the source Android cmdline :https://send.firefox.com/download/99113cd2f2330410/#dQ1meOrjTUQtH6tKI7SwBg arch_disk:Android_cmdline.zip

procedure TGpioSU.OpenGpioRights;
var
  Cmd: TStringList;
begin
  Cmd := TStringList.Create;
  try
    Cmd.Add('su');
    Cmd.Add('chmod -R 777 /sys/class/gpio');
    Cmd.Add('exit');
    RunAndroidCmd(Cmd, True, Nil);
  finally
    Cmd.Free;
  end;
end;

Thank you very much for your help. Code is working fine .

I need some more help .

How i can read output from shell commands ?

For example in Raspbian i get the temperature with these commands

pi@raspberrypi ~ $ cd /opt/vc/bin
pi@raspberrypi /opt/vc/bin $ LD_LIBRARY_PATH=/opt/vc/lib ./vcgencmd measure_temp
temp=49.2'C

temp=49.2'C is the output and i can read it in Lazarus and CodeOcean using
process and stream. 

How i will read the output 'temp=49.2'C' from my Delphi code in Android ?

Is there any documentation ?

Hi, runandroidcmd accept a parameter tstring which returns the output


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
【Matlab】常用函数发布时间:2022-07-18
下一篇:
基于声卡和Matlab的虚拟信号发生器[图]发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap