summaryrefslogtreecommitdiff
path: root/polux/tools/mtd-utils/checkfs/comm.c
diff options
context:
space:
mode:
authorJean-Philippe SAVE2012-02-20 16:38:56 +0100
committerJean-Philippe SAVE2012-02-20 16:38:56 +0100
commit55a15cc820e926219ebce47218ce1e2f35bb0c48 (patch)
treedba3ff39a766e47859ab7fd837d8da5d30b56b1f /polux/tools/mtd-utils/checkfs/comm.c
parent1353d3215782b997fdec3f9182cbda547d92d7e9 (diff)
parentcfc4d43d4d19c398d994b75cb1eeda3c499bd234 (diff)
Add polux base by subtree merge
Diffstat (limited to 'polux/tools/mtd-utils/checkfs/comm.c')
-rw-r--r--polux/tools/mtd-utils/checkfs/comm.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/polux/tools/mtd-utils/checkfs/comm.c b/polux/tools/mtd-utils/checkfs/comm.c
new file mode 100644
index 0000000000..57fc7edb96
--- /dev/null
+++ b/polux/tools/mtd-utils/checkfs/comm.c
@@ -0,0 +1,67 @@
+/*
+ File: comm.c
+ Desc: This file implements the actual transmission portion
+ of the "ok to power me down" message to the remote
+ power cycling black box.
+
+ It's been sepatated into a separate file so that
+ it may be replaced by any other comm mechanism desired.
+
+ (including none or non serial mode at all)
+
+ $Id: comm.c,v 1.3 2005/11/07 11:15:17 gleixner Exp $
+ $Log: comm.c,v $
+ Revision 1.3 2005/11/07 11:15:17 gleixner
+ [MTD / JFFS2] Clean up trailing white spaces
+
+ Revision 1.2 2001/06/21 23:07:18 dwmw2
+ Initial import to MTD CVS
+
+ Revision 1.1 2001/06/08 22:26:05 vipin
+ Split the modbus comm part of the program (that sends the ok to pwr me down
+ message) into another file "comm.c"
+
+
+
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+
+
+/*
+ This is the routine that forms and
+ sends the "ok to pwr me down" message
+ to the remote power cycling "black box".
+
+ */
+int do_pwr_dn(int fd, int cycleCnt)
+{
+
+ char buf[200];
+
+ sprintf(buf, "ok to power me down!\nCount = %i\n", cycleCnt);
+
+ if(write(fd, buf, strlen(buf)) < strlen(buf))
+ {
+ perror("write error");
+ return -1;
+ }
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+