<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de-AT">
		<id>http://old.ethersex.de/index.php?action=history&amp;feed=atom&amp;title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD</id>
		<title>Zugriff auf die SD-Karte über ECMD - Versionsgeschichte</title>
		<link rel="self" type="application/atom+xml" href="http://old.ethersex.de/index.php?action=history&amp;feed=atom&amp;title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD"/>
		<link rel="alternate" type="text/html" href="http://old.ethersex.de/index.php?title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD&amp;action=history"/>
		<updated>2026-04-11T20:23:09Z</updated>
		<subtitle>Versionsgeschichte dieser Seite in Ethersex_Wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://old.ethersex.de/index.php?title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD&amp;diff=4653&amp;oldid=prev</id>
		<title>C Classic am 28. Dezember 2010 um 16:04 Uhr</title>
		<link rel="alternate" type="text/html" href="http://old.ethersex.de/index.php?title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD&amp;diff=4653&amp;oldid=prev"/>
				<updated>2010-12-28T16:04:38Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://old.ethersex.de/index.php?title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD&amp;amp;diff=4653&amp;amp;oldid=4652&quot;&gt;Änderungen zeigen&lt;/a&gt;</summary>
		<author><name>C Classic</name></author>	</entry>

	<entry>
		<id>http://old.ethersex.de/index.php?title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD&amp;diff=4652&amp;oldid=prev</id>
		<title>C Classic am 28. Dezember 2010 um 11:58 Uhr</title>
		<link rel="alternate" type="text/html" href="http://old.ethersex.de/index.php?title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD&amp;diff=4652&amp;oldid=prev"/>
				<updated>2010-12-28T11:58:14Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;de-AT&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 28. Dezember 2010, 11:58 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l98&quot; &gt;Zeile 98:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 98:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Wenn der Befehl ungültig ist (z.B. bei Write nur der Dateiname) kann das System abstürzen&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Wenn der Befehl ungültig ist (z.B. bei Write nur der Dateiname) kann das System abstürzen&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Ordentlichen Remove-Befehl&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Ordentlichen Remove-Befehl&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Ethersex]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Hardware]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:SD-Karte]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>C Classic</name></author>	</entry>

	<entry>
		<id>http://old.ethersex.de/index.php?title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD&amp;diff=4651&amp;oldid=prev</id>
		<title>C Classic: Die Seite wurde neu angelegt: == Übersicht == * sd create [Dateiname] Erstellt die angegebene Datei. * sd write [Dateiname] [Text] Schreibt den Text in die angegebene Datei.(Datei MUSS existieren) ...</title>
		<link rel="alternate" type="text/html" href="http://old.ethersex.de/index.php?title=Zugriff_auf_die_SD-Karte_%C3%BCber_ECMD&amp;diff=4651&amp;oldid=prev"/>
				<updated>2010-12-28T11:55:48Z</updated>
		
		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: == Übersicht == * sd create [Dateiname] Erstellt die angegebene Datei. * sd write [Dateiname] [Text] Schreibt den Text in die angegebene Datei.(Datei MUSS existieren) ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Übersicht ==&lt;br /&gt;
* sd create [Dateiname] Erstellt die angegebene Datei.&lt;br /&gt;
* sd write [Dateiname] [Text] Schreibt den Text in die angegebene Datei.(Datei MUSS existieren) &lt;br /&gt;
* sd read [Dateiname] Ließt eine Datei ein und gibt der Text über die serielle Schnittstelle aus. (WICHTIG: Die Variable buffer[] muss auf die benötigte Größe angepasst werden!)&lt;br /&gt;
* sd remove [Dateiname] Setzt die Größe der Datei auf 0&lt;br /&gt;
&lt;br /&gt;
== Aktivieren der Funktionen ==&lt;br /&gt;
Die Funktionen sind momentan noch nicht in der Standard-Version vorhanden. Sie müssen somit manuell nachgerüstet werden.&lt;br /&gt;
&lt;br /&gt;
Dazu muss man als erstes die Datei &amp;quot;hardware/storage/sd_reader/ecmd.c&amp;quot; öffnen.&lt;br /&gt;
Über dem Ethersex-Meta-Block fügt man folgenden Code ein:&lt;br /&gt;
&lt;br /&gt;
 int16_t&lt;br /&gt;
 parse_cmd_sd_create (char *cmd, char *output, uint16_t len)&lt;br /&gt;
 {&lt;br /&gt;
  if (vfs_sd_rootnode == 0) return ECMD_FINAL(snprintf_P(output, len, PSTR(&amp;quot;SD/MMC backend not available.&amp;quot;)));&lt;br /&gt;
  while (*cmd == ' ') cmd ++;&lt;br /&gt;
  /* Do this to protect the server from crashing when the filename contains a space */&lt;br /&gt;
  int x=0;&lt;br /&gt;
  while (cmd[x] != ' ') {&lt;br /&gt;
 	x++;	&lt;br /&gt;
  }&lt;br /&gt;
  cmd[x] = 0;&lt;br /&gt;
  vfs_file_handle_sd_t handle = vfs_sd_create (cmd);&lt;br /&gt;
  vfs_sd_close(handle);&lt;br /&gt;
  return ECMD_FINAL_OK;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int16_t&lt;br /&gt;
 parse_cmd_sd_write (char *cmd, char *output, uint16_t len)&lt;br /&gt;
 {&lt;br /&gt;
  if (vfs_sd_rootnode == 0) return ECMD_FINAL(snprintf_P(output, len, PSTR(&amp;quot;SD/MMC backend not available.&amp;quot;)));&lt;br /&gt;
  while (*cmd == ' ') cmd ++;&lt;br /&gt;
  int x=0;&lt;br /&gt;
  while (cmd[x] != ' ') {&lt;br /&gt;
 	x++;	&lt;br /&gt;
  }&lt;br /&gt;
  cmd[x] = 0;&lt;br /&gt;
  vfs_file_handle_sd_t handle = vfs_sd_open (cmd);&lt;br /&gt;
  cmd[x] = ' ';&lt;br /&gt;
  while (*cmd != ' ') cmd ++;&lt;br /&gt;
  vfs_sd_truncate (handle, strlen(cmd));&lt;br /&gt;
  vfs_sd_write (handle, cmd,&lt;br /&gt;
 			  strlen(cmd));&lt;br /&gt;
  vfs_sd_close(handle);&lt;br /&gt;
  return ECMD_FINAL_OK;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int16_t&lt;br /&gt;
 parse_cmd_sd_read (char *cmd, char *output, uint16_t len)&lt;br /&gt;
 {&lt;br /&gt;
  if (vfs_sd_rootnode == 0) return ECMD_FINAL(snprintf_P(output, len, PSTR(&amp;quot;SD/MMC backend not available.&amp;quot;)));&lt;br /&gt;
  while (*cmd == ' ') cmd ++;&lt;br /&gt;
  /* Do this to protect the server from crashing when the filename contains a space */&lt;br /&gt;
  int x=0;&lt;br /&gt;
  while (cmd[x] != ' ') {&lt;br /&gt;
 	x++;	&lt;br /&gt;
  }&lt;br /&gt;
  cmd[x] = 0;&lt;br /&gt;
  vfs_file_handle_sd_t handle = vfs_sd_open (cmd);&lt;br /&gt;
  char buffer[100]=&amp;quot;EMPTY&amp;quot;;&lt;br /&gt;
  int size = vfs_sd_size (handle);&lt;br /&gt;
  vfs_sd_read  (handle, buffer,&lt;br /&gt;
 		   size);&lt;br /&gt;
  printf(buffer); //DEBUG (How can I return a whole string???)&lt;br /&gt;
  vfs_sd_close(handle);&lt;br /&gt;
  return buffer;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int16_t&lt;br /&gt;
 parse_cmd_sd_remove (char *cmd, char *output, uint16_t len) //DUMMY&lt;br /&gt;
 {&lt;br /&gt;
  if (vfs_sd_rootnode == 0) return ECMD_FINAL(snprintf_P(output, len, PSTR(&amp;quot;SD/MMC backend not available.&amp;quot;)));&lt;br /&gt;
  while (*cmd == ' ') cmd ++;&lt;br /&gt;
  /* Do this to protect the server from crashing when the filename contains a space */&lt;br /&gt;
  int x=0;&lt;br /&gt;
  while (cmd[x] != ' ') {&lt;br /&gt;
 	x++;	&lt;br /&gt;
  }&lt;br /&gt;
  cmd[x] = 0;&lt;br /&gt;
  vfs_file_handle_sd_t handle = vfs_sd_open (cmd);&lt;br /&gt;
  vfs_sd_truncate (handle, 0);&lt;br /&gt;
  vfs_sd_close(handle);&lt;br /&gt;
  return ECMD_FINAL_OK;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Und folgende Zeilen müssen dem Meta-Block hinzugefügt werden:&lt;br /&gt;
  ecmd_feature(sd_read, &amp;quot;sd read&amp;quot;,PATH, Returns the content of the given file.)&lt;br /&gt;
  ecmd_feature(sd_write, &amp;quot;sd write&amp;quot;,PATH_TEXT, Write the given data to the specified file.)&lt;br /&gt;
  ecmd_feature(sd_create, &amp;quot;sd create&amp;quot;,PATH, Create a new file.)&lt;br /&gt;
  ecmd_feature(sd_remove, &amp;quot;sd remove&amp;quot;,PATH, Remove a file.)&lt;br /&gt;
&lt;br /&gt;
== Verwenden der Befehle ==&lt;br /&gt;
Die Befehle können über alle ecmd-fähigen Module aufgerufen werden. (Seriell, HTTPD, ...)&lt;br /&gt;
Nur der Read-Befehl gibt immer über seriell aus.&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
* Wenn der Befehl ungültig ist (z.B. bei Write nur der Dateiname) kann das System abstürzen&lt;br /&gt;
* Ordentlichen Remove-Befehl&lt;/div&gt;</summary>
		<author><name>C Classic</name></author>	</entry>

	</feed>