📄 pagedmemorybank.java
字号:
* {@link #readPagePacket(int,boolean,byte[],int) readPagePacket} * method or have the 1-Wire device provide the * CRC as in * {@link #readPageCRC(int,boolean,byte[],int) readPageCRC}. * However device CRC generation is not * supported on all memory types, see * {@link #hasPageAutoCRC() hasPageAutoCRC}. * If neither is an option then this method could be called more * then once to at least verify that the same data is read consistently. * * The readContinue parameter is used to eliminate the overhead in re-accessing * a part already being read from. For example, if pages 0 - 4 are to * be read, readContinue would be set to false for page 0 and would be set * to true for the next four calls. * <P> Note: Using readContinue = true can only be used if the new * read continues where the last one left off * and it is inside a 'beginExclusive/endExclusive' * block. * * @param page page number to read packet from * @param readContinue <CODE> true </CODE> then device read * is continued without re-selecting * @param readBuf location for data read * @param offset offset into readBuf to place data * * @throws OneWireIOException on a 1-Wire communication error such as * no 1-Wire device present. This could be * caused by a physical interruption in the 1-Wire Network due to * shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. * @throws OneWireException on a communication or setup error with the 1-Wire * adapter */ public void readPage (int page, boolean readContinue, byte[] readBuf, int offset) throws OneWireIOException, OneWireException; /** * Reads a page in this memory bank with extra information with no * CRC checking (device or data). The resulting data from this API * may or may not be what is on the 1-Wire device. It is recommends * that the data contain some kind of checking (CRC) like in the * {@link #readPagePacket(int,boolean,byte[],int,byte[]) readPagePacket} * method or have the 1-Wire device provide the * CRC as in * {@link #readPageCRC(int,boolean,byte[],int,byte[]) readPageCRC}. * However device CRC generation is not * supported on all memory types, see * {@link #hasPageAutoCRC() hasPageAutoCRC}. * If neither is an option then this method could be called more * then once to at least verify that the same data is read consistently.The * readContinue parameter is used to eliminate the overhead in re-accessing * a part already being read from. For example, if pages 0 - 4 are to * be read, readContinue would be set to false for page 0 and would be set * to true for the next four calls. * * <P> Note: Using readContinue = true can only be used if the new * read continues where the last one left off * and it is inside a 'beginExclusive/endExclusive' * block. * * @param page page number to read packet from * @param readContinue <CODE> true </CODE> then device read * is continued without re-selecting * @param readBuf location for data read * @param offset offset into readBuf to place data * @param extraInfo location for extra info read * * @throws OneWireIOException on a 1-Wire communication error such as * no 1-Wire device present. This could be * caused by a physical interruption in the 1-Wire Network due to * shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. * @throws OneWireException on a communication or setup error with the 1-Wire * adapter * * @see #hasExtraInfo() hasExtraInfo * @see #getExtraInfoLength() getExtraInfoLength */ public void readPage (int page, boolean readContinue, byte[] readBuf, int offset, byte[] extraInfo) throws OneWireIOException, OneWireException; /** * Reads a Universal Data Packet. * * The Universal Data Packet always starts on page boundaries but * can end anywhere in the page. The structure specifies the length of * data bytes not including the length byte and the CRC16 bytes. * There is one length byte. The CRC16 is first initialized to * the page number. This provides a check to verify the page that * was intended is being read. The CRC16 is then calculated over * the length and data bytes. The CRC16 is then inverted and stored * low byte first followed by the high byte. The structure is * used by this method to verify the data but only * the data payload is returned. The * readContinue parameter is used to eliminate the overhead in re-accessing * a part already being read from. For example, if pages 0 - 4 are to * be read, readContinue would be set to false for page 0 and would be set * to true for the next four calls. * * <P> See Dallas Semiconductor Application Note 114 * for details: <A HREF="http://dbserv.maxim-ic.com/appnotes.cfm?appnote_number=114"> * http://dbserv.maxim-ic.com/appnotes.cfm?appnote_number=114</A> * * <P> Note: Using readContinue = true can only be used if the new * read continues where the last one left off * and it is inside a 'beginExclusive/endExclusive' * block. * * @param page page number to read packet from * @param readContinue <CODE> true </CODE> true then device read * is continued without re-selecting * @param readBuf location for data read * @param offset offset into readBuf to place data * * @return number of data bytes read from the device and saved to * readBuf at the provided offset * * @throws OneWireIOException on a 1-Wire communication error such as * an invalid CRC16 or length found in the packet. This could be * caused by a physical interruption in the 1-Wire Network due to * shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. * It could also be caused due to the device page not containing a * valid packet. * @throws OneWireException on a communication or setup error with the 1-Wire * adapter * * @see #getMaxPacketDataLength() getMaxPacketDataLength */ public int readPagePacket (int page, boolean readContinue, byte[] readBuf, int offset) throws OneWireIOException, OneWireException; /** * Reads a Universal Data Packet and extra information. See the * method * {@link #readPagePacket(int,boolean,byte[],int) readPagePacket} * for a description of the packet structure. The * readContinue parameter is used to eliminate the overhead in re-accessing * a part already being read from. For example, if pages 0 - 4 are to * be read, readContinue would be set to false for page 0 and would be set * to true for the next four calls. * * <P> Note: Using readContinue = true can only be used if the new * read continues where the last one left off * and it is inside a 'beginExclusive/endExclusive' * block. * * @param page page number to read packet from * @param readContinue <CODE> true </CODE> then device read * is continued without re-selecting * @param readBuf location for data read * @param offset offset into readBuf to place data * @param extraInfo location for extra info read * * @return number of data bytes read from the device and written to * readBuf at the offset. * * @throws OneWireIOException on a 1-Wire communication error such as * an invalid CRC16 or length found in the packet. This could be * caused by a physical interruption in the 1-Wire Network due to * shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. * It could also be caused due to the device page not containing a * valid packet. * @throws OneWireException on a communication or setup error with the 1-Wire * adapter * * @see #hasExtraInfo() hasExtraInfo * @see #getExtraInfoLength() getExtraInfoLength * @see #getMaxPacketDataLength() getMaxPacketDataLength */ public int readPagePacket (int page, boolean readContinue, byte[] readBuf, int offset, byte[] extraInfo) throws OneWireIOException, OneWireException; /** * Writes a Universal Data Packet. See the method * {@link #readPagePacket(int,boolean,byte[],int) readPagePacket} * for a description of the packet structure. * * @param page page number to write packet to * @param writeBuf data to write * @param offset offset into writeBuf where data to write is * @param len number of bytes to write with a max of * {@link #getMaxPacketDataLength() getMaxPacketDataLength} * elements * * @throws OneWireIOException on a 1-Wire communication error such as * read verification error on write. This could be * caused by a physical interruption in the 1-Wire Network due to * shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. * It could also be caused due to the device page being write protected. * @throws OneWireException on a communication or setup error with the 1-Wire * adapter * * @see #getMaxPacketDataLength() getMaxPacketDataLength */ public void writePagePacket (int page, byte[] writeBuf, int offset, int len) throws OneWireIOException, OneWireException; /** * Reads a complete memory page with CRC verification provided by the * device. Not supported by all devices. The * readContinue parameter is used to eliminate the overhead in re-accessing * a part already being read from. For example, if pages 0 - 4 are to * be read, readContinue would be set to false for page 0 and would be set * to true for the next four calls. * * <P> Note: Using readContinue = true can only be used if the new * read continues where the last one left off * and it is inside a 'beginExclusive/endExclusive' * block. * * @param page page number to read * @param readContinue <CODE> true </CODE> true then device read * is continued without re-selecting * @param readBuf location for data read * @param offset offset into readBuf to place data * * @throws OneWireIOException on a 1-Wire communication error such as * an invalid CRC read from device. This could be * caused by a physical interruption in the 1-Wire Network due to * shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. * @throws OneWireException on a communication or setup error with the 1-Wire * adapter * * @see #hasPageAutoCRC() hasPageAutoCRC * @see #getPageLength() getPageLength */ public void readPageCRC (int page, boolean readContinue, byte[] readBuf, int offset) throws OneWireIOException, OneWireException; /** * Reads a complete memory page with CRC verification provided by the * device with extra information. Not supported by all devices. The * readContinue parameter is used to eliminate the overhead in re-accessing * a part already being read from. For example, if pages 0 - 4 are to * be read, readContinue would be set to false for page 0 and would be set * to true for the next four calls. * * * <P> Note: Using readContinue = true can only be used if the new * read continues where the last one left off * and it is inside a 'beginExclusive/endExclusive' * block. * * @param page page number to read * @param readContinue <CODE> true </CODE> true then device read * is issued without continued without re-selecting * @param readBuf location for data read * @param offset offset into readBuf to place data * @param extraInfo location for extra info read * * @throws OneWireIOException on a 1-Wire communication error such as * an invalid CRC read from device. This could be * caused by a physical interruption in the 1-Wire Network due to * shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. * @throws OneWireException on a communication or setup error with the 1-Wire * adapter * * @see #hasExtraInfo() hasExtraInfo * @see #getExtraInfoLength() getExtraInfoLength * @see #hasPageAutoCRC() hasPageAutoCRC * @see #getPageLength() getPageLength */ public void readPageCRC (int page, boolean readContinue, byte[] readBuf, int offset, byte[] extraInfo) throws OneWireIOException, OneWireException;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -